Package java.util

Examples of java.util.Properties.containsKey()


   
    int count(String event, Collection<Report> reports) {
        int count = 0;
        for (Report report : reports) {
            Properties stats = report.asProperties("stats");
            if (stats.containsKey(event)) {
                count = count + Integer.parseInt((String) stats.get(event));
            }
        }
        return count;
    }
View Full Code Here


    Properties properties = StringUtils.splitArrayElementsIntoProperties(parameters, "=");
    if (properties == null) {
      properties = new Properties();
    }

    if (!properties.containsKey(AppmasterConstants.CONTAINER_COUNT)) {
      log.info("Setting container count set externally " + containerCount);
      properties.put(AppmasterConstants.CONTAINER_COUNT, Integer.toString(containerCount));
    }
    appmaster.setParameters(properties);
    appmaster.setEnvironment(System.getenv());
View Full Code Here

   private boolean disableBatching;
  
   public TcpTransport()
   {
      Properties systemProperties = System.getProperties();
      if (systemProperties.containsKey(disableBatchingSystemProperty))
      {
         String tmp = System.getProperty(disableBatchingSystemProperty);
        
         // if -DdisableBatching is set and it's NOT set to a negative indicator,
         // then it will be true.
View Full Code Here

                try {
                    properties.load(in);
                } finally {
                    in.close();
                }
                String existingFeatureRepos = properties.containsKey(FEATURES_REPOSITORIES)? properties.getProperty(FEATURES_REPOSITORIES) + ",": "";
                existingFeatureRepos = existingFeatureRepos + url.toString();
                properties.setProperty(FEATURES_REPOSITORIES, existingFeatureRepos);
                FileOutputStream out = new FileOutputStream(featuresCfgFile);
                try {
                    properties.store(out, "Features Service config");
View Full Code Here

        this.destPattern = destPattern;
        this.env = env;

        Properties options = project.getOptions();

        addMissingImports = options.containsKey(BldAttr.OPTION_ADD_IMPORTS)
            && Boolean.parseBoolean(options.getProperty(BldAttr.OPTION_ADD_IMPORTS));
        omitUnusedImports = options.containsKey(BldAttr.OPTION_OMIT_IMPORTS)
            && Boolean.parseBoolean(options.getProperty(BldAttr.OPTION_OMIT_IMPORTS));

        for (IBldBundle b : project.getBundles())
View Full Code Here

        Properties options = project.getOptions();

        addMissingImports = options.containsKey(BldAttr.OPTION_ADD_IMPORTS)
            && Boolean.parseBoolean(options.getProperty(BldAttr.OPTION_ADD_IMPORTS));
        omitUnusedImports = options.containsKey(BldAttr.OPTION_OMIT_IMPORTS)
            && Boolean.parseBoolean(options.getProperty(BldAttr.OPTION_OMIT_IMPORTS));

        for (IBldBundle b : project.getBundles())
        {
            lastBundle = b.getId();
View Full Code Here

                try
                {
                    in = new FileInputStream(loc);
                    props.load(in);
                   
                    if (type.isDynamic() && !props.containsKey(RepositoryModel.NAME)) {
                        String name = prefs.getString(key + NAME);
                        props.setProperty(RepositoryModel.NAME, name);
                    }
                   
                }
View Full Code Here

                    }
                }
            }
        }

        if (!props.containsKey(IRepositoryConfig.REPOSITORY_PROVIDER)) {
            props.setProperty(IRepositoryConfig.REPOSITORY_PROVIDER, type.getProvider());
        }

        props.setProperty("id", id);
View Full Code Here

        BldConfig c = loadDefaults(p, baseDir, null);
        config.setDefault(c);

        Properties options = config.getProps(null, BldConfig.P_OPTION);

        if (!options.containsKey(BldAttr.OPTION_ADD_IMPORTS))
            c.setProp(null, BldConfig.P_OPTION, BldAttr.OPTION_ADD_IMPORTS, "true");

        // default omitUnusedImports option depends on number of bundles...
        // we set it here to avoid it being written by save(),
        // but as this may alter cached defaults, once set we have to reset it
View Full Code Here

        // default omitUnusedImports option depends on number of bundles...
        // we set it here to avoid it being written by save(),
        // but as this may alter cached defaults, once set we have to reset it
        // for each project.

        boolean omitSet = options.containsKey("__omit_set__");
        boolean multiple = getBundleIds().size() > 1;

        if (multiple || omitSet)
        {
            if (!options.containsKey(BldAttr.OPTION_OMIT_IMPORTS) || omitSet)
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.