コード例 #1
0
  /**
   * Returns true if a parameter with the given name exists.
   *
   * @param key The name of the parameter to check.
   * @param explicit If <tt>true</tt>, we only check for a value which is definitely stored
   *     explicitly, <tt>false</tt> means that we'll also check against configuration defaults too.
   */
  public boolean hasParameter(String key, boolean explicit) {

    // We have an explicit value set.
    if (propertiesMap.containsKey(key)) {
      return true;
    }

    // We have a default value set.
    if ((!explicit) && ConfigurationDefaults.getInstance().hasParameter(key)) {
      return true;
    }

    return false;
  }
コード例 #2
0
 /**
  * Does the given parameter exist.
  *
  * @param parameter to check
  * @return true if exists, false if not present
  */
 public boolean doesParameterNonDefaultExist(String parameter) {
   return propertiesMap.containsKey(parameter);
 }