jdk/src/java.base/share/classes/java/util/Properties.java
changeset 38772 545bcf25bef0
parent 38436 4676f6c9ebee
child 44035 f3871cc7914a
equal deleted inserted replaced
38771:fdbc4de9dfc9 38772:545bcf25bef0
  1035         enumerate(h);
  1035         enumerate(h);
  1036         return h.keys();
  1036         return h.keys();
  1037     }
  1037     }
  1038 
  1038 
  1039     /**
  1039     /**
  1040      * Returns a set of keys in this property list where
  1040      * Returns an unmodifiable set of keys from this property list
  1041      * the key and its corresponding value are strings,
  1041      * where the key and its corresponding value are strings,
  1042      * including distinct keys in the default property list if a key
  1042      * including distinct keys in the default property list if a key
  1043      * of the same name has not already been found from the main
  1043      * of the same name has not already been found from the main
  1044      * properties list.  Properties whose key or value is not
  1044      * properties list.  Properties whose key or value is not
  1045      * of type {@code String} are omitted.
  1045      * of type {@code String} are omitted.
  1046      * <p>
  1046      * <p>
  1047      * The returned set is not backed by the {@code Properties} object.
  1047      * The returned set is not backed by this {@code Properties} object.
  1048      * Changes to this {@code Properties} are not reflected in the set,
  1048      * Changes to this {@code Properties} object are not reflected in the
  1049      * or vice versa.
  1049      * returned set.
  1050      *
  1050      *
  1051      * @return  a set of keys in this property list where
  1051      * @return  an unmodifiable set of keys in this property list where
  1052      *          the key and its corresponding value are strings,
  1052      *          the key and its corresponding value are strings,
  1053      *          including the keys in the default property list.
  1053      *          including the keys in the default property list.
  1054      * @see     java.util.Properties#defaults
  1054      * @see     java.util.Properties#defaults
  1055      * @since   1.6
  1055      * @since   1.6
  1056      */
  1056      */
  1057     public Set<String> stringPropertyNames() {
  1057     public Set<String> stringPropertyNames() {
  1058         Map<String, String> h = new HashMap<>();
  1058         Map<String, String> h = new HashMap<>();
  1059         enumerateStringProperties(h);
  1059         enumerateStringProperties(h);
  1060         return h.keySet();
  1060         return Collections.unmodifiableSet(h.keySet());
  1061     }
  1061     }
  1062 
  1062 
  1063     /**
  1063     /**
  1064      * Prints this property list out to the specified output stream.
  1064      * Prints this property list out to the specified output stream.
  1065      * This method is useful for debugging.
  1065      * This method is useful for debugging.