本文整理汇总了Java中java.util.Properties.contains方法的典型用法代码示例。如果您正苦于以下问题:Java Properties.contains方法的具体用法?Java Properties.contains怎么用?Java Properties.contains使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类java.util.Properties
的用法示例。
在下文中一共展示了Properties.contains方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: setDeprecatedProperties
import java.util.Properties; //导入方法依赖的package包/类
/**
* Sets all deprecated properties that are not currently set but have a
* corresponding new property that is set. Useful for iterating the
* properties when all deprecated properties for currently set properties
* need to be present.
*/
public void setDeprecatedProperties() {
DeprecationContext deprecations = deprecationContext.get();
Properties props = getProps();
Properties overlay = getOverlay();
for (Map.Entry<String, DeprecatedKeyInfo> entry :
deprecations.getDeprecatedKeyMap().entrySet()) {
String depKey = entry.getKey();
if (!overlay.contains(depKey)) {
for (String newKey : entry.getValue().newKeys) {
String val = overlay.getProperty(newKey);
if (val != null) {
props.setProperty(depKey, val);
overlay.setProperty(depKey, val);
break;
}
}
}
}
}
示例2: getAllDistributedSystemProperties
import java.util.Properties; //导入方法依赖的package包/类
public final static Properties getAllDistributedSystemProperties(Properties props) {
Properties p = DUnitEnv.get().getDistributedSystemProperties();
// our tests do not expect auto-reconnect to be on by default
if (!p.contains(DistributionConfig.DISABLE_AUTO_RECONNECT_NAME)) {
p.put(DistributionConfig.DISABLE_AUTO_RECONNECT_NAME, "true");
}
for (Iterator iter = props.entrySet().iterator();
iter.hasNext(); ) {
Map.Entry entry = (Map.Entry) iter.next();
String key = (String) entry.getKey();
Object value = entry.getValue();
p.put(key, value);
}
return p;
}
示例3: getAllDistributedSystemProperties
import java.util.Properties; //导入方法依赖的package包/类
public final static Properties getAllDistributedSystemProperties(final Properties properties) {
Properties dsProperties = DUnitEnv.get().getDistributedSystemProperties();
// our tests do not expect auto-reconnect to be on by default
if (!dsProperties.contains(DISABLE_AUTO_RECONNECT)) {
dsProperties.put(DISABLE_AUTO_RECONNECT, "true");
}
for (Iterator<Map.Entry<Object, Object>> iterator = properties.entrySet().iterator(); iterator
.hasNext();) {
Map.Entry<Object, Object> entry = iterator.next();
String key = (String) entry.getKey();
Object value = entry.getValue();
dsProperties.put(key, value);
}
System.out.println("distributed system properties: " + dsProperties);
return dsProperties;
}
示例4: resolve
import java.util.Properties; //导入方法依赖的package包/类
@SuppressWarnings( {"unchecked"} )
void resolve() {
for ( EntityBinding entityBinding : metadata.getEntityBindings() ) {
if ( entityBinding.isRoot() ) {
Properties properties = new Properties( );
properties.putAll(
metadata.getServiceRegistry()
.getService( ConfigurationService.class )
.getSettings()
);
//TODO: where should these be added???
if ( ! properties.contains( AvailableSettings.PREFER_POOLED_VALUES_LO ) ) {
properties.put( AvailableSettings.PREFER_POOLED_VALUES_LO, "false" );
}
if ( ! properties.contains( PersistentIdentifierGenerator.IDENTIFIER_NORMALIZER ) ) {
properties.put(
PersistentIdentifierGenerator.IDENTIFIER_NORMALIZER,
new ObjectNameNormalizerImpl( metadata )
);
}
entityBinding.getHierarchyDetails().getEntityIdentifier().createIdentifierGenerator(
metadata.getIdentifierGeneratorFactory(),
properties
);
}
}
}
示例5: Initialize
import java.util.Properties; //导入方法依赖的package包/类
@Override
public void Initialize(Properties props) {
server = props.getProperty("server");
user = props.getProperty("user");
password = props.getProperty("password");
file = props.getProperty("file");
if (props.contains("port"))
port = Integer.parseInt(props.getProperty("port"));
}