private Object normalize(Object key){ if (key instanceof String) { return normalize((String)key); } return key; }
private Object normalize(final Object key) { if (key instanceof String) { return normalize((String) key); } return key; }
@Override public Object get(Object key) { key = normalize(key); return properties.get(key); }
public boolean containsKey(Object key) { key = normalize(key); return properties.containsKey(key); }
@Override public boolean containsKey(Object key) { key = normalize(key); return properties.containsKey(key); }
private Object normalize(final Object key) { if (STRING.isInstance(key)) { return normalize(STRING.cast(key)); } return key; }
public Object get(Object key) { key = normalize(key); return properties.get(key); }
public boolean containsKey(Object key) { key = normalize(key); return properties.containsKey(key); }
public Object get(Object key) { key = normalize(key); return properties.get(key); }
public Object remove(Object key) { key = normalize(key); comments.remove(key); attributes.remove(key); return properties.remove(key); }
public Object remove(Object key) { key = normalize(key); comments.remove(key); attributes.remove(key); return properties.remove(key); }
/** * Sets the comment associated with a property. * @param name the property name; not null * @param comment the comment; not null */ public void setComment(String name, String comment) { if (name == null) throw new NullPointerException("name is null"); if (comment == null) throw new NullPointerException("comment is null"); name = normalize(name); comments.put(name, comment); }
@Override public Object remove(Object key) { key = normalize(key); comments.remove(key); attributes.remove(key); return properties.remove(key); }
public Object put(Object key, final Object value) { key = normalize(key); if (key instanceof String) { final String name = (String) key; if (!attributes.containsKey(name)) { attributes.put(name, new LinkedHashMap<String, String>()); } } return properties.put(key, value); }
public Object put(Object key, Object value) { key = normalize(key); if (key instanceof String) { String name = (String) key; if (!attributes.containsKey(name)) { attributes.put(name, new LinkedHashMap<String,String>()); } } return properties.put(key, value); }
@Override public Object put(Object key, final Object value) { key = normalize(key); if (STRING.isInstance(key)) { final String name = STRING.cast(key); if (!attributes.containsKey(name)) { attributes.put(name, new LinkedHashMap<String, String>()); } } return properties.put(key, value); }
public void putAll(Map<?, ?> t) { for (Map.Entry<?, ?> entry : t.entrySet()) { put(entry.getKey(), entry.getValue()); } if (t instanceof SuperProperties) { SuperProperties superProperties = (SuperProperties) t; for (Map.Entry<String, String> entry : superProperties.comments.entrySet()) { comments.put(normalize(entry.getKey()), entry.getValue()); } for (Map.Entry<String, LinkedHashMap<String, String>> entry : superProperties.attributes.entrySet()) { attributes.put(normalize(entry.getKey()), entry.getValue()); } } }
public void putAll(final Map<?, ?> t) { for (final Map.Entry<?, ?> entry : t.entrySet()) { put(entry.getKey(), entry.getValue()); } if (t instanceof SuperProperties) { final SuperProperties superProperties = (SuperProperties) t; for (final Map.Entry<String, String> entry : superProperties.comments.entrySet()) { comments.put(normalize(entry.getKey()), entry.getValue()); } for (final Map.Entry<String, LinkedHashMap<String, String>> entry : superProperties.attributes.entrySet()) { attributes.put(normalize(entry.getKey()), entry.getValue()); } } }
@Override public void putAll(final Map<?, ?> t) { for (final Map.Entry<?, ?> entry : t.entrySet()) { put(entry.getKey(), entry.getValue()); } if (t instanceof SuperProperties) { final SuperProperties superProperties = (SuperProperties) t; for (final Map.Entry<String, String> entry : superProperties.comments.entrySet()) { comments.put(normalize(entry.getKey()), entry.getValue()); } for (final Map.Entry<String, LinkedHashMap<String, String>> entry : superProperties.attributes.entrySet()) { attributes.put(normalize(entry.getKey()), entry.getValue()); } } }
/** * Searches for the comment associated with the specified property. If the property is not found, look * in the default properties. If the property is not found in the default properties, answer null. * * @param name the name of the property to find * @return the named property value */ public String getComment(String name) { name = normalize(name); String comment = comments.get(name); if (comment == null && defaults instanceof SuperProperties) { comment = ((SuperProperties) defaults).getComment(name); } return comment; }