本文整理匯總了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"));
}