当前位置: 首页>>代码示例>>Java>>正文


Java Properties.contains方法代码示例

本文整理汇总了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;
        }
      }
    }
  }
}
 
开发者ID:nucypher,项目名称:hadoop-oss,代码行数:26,代码来源:Configuration.java

示例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;
}
 
开发者ID:ampool,项目名称:monarch,代码行数:18,代码来源:DistributedTestCase.java

示例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;
}
 
开发者ID:ampool,项目名称:monarch,代码行数:19,代码来源:DistributedTestUtils.java

示例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
			);
		}
	}
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:28,代码来源:IdentifierGeneratorResolver.java

示例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"));
}
 
开发者ID:GIScience,项目名称:openrouteservice,代码行数:10,代码来源:FtpDataSource.java


注:本文中的java.util.Properties.contains方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。