當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。