public boolean hasAttribute(String key) { return commonInfo.hasAttribute(key); } public Object getAttribute(String key) { return commonInfo.getAttribute(key); }
public boolean hasAttribute(String key) { return commonInfo.hasAttribute(key); } public Object getAttribute(String key) { return commonInfo.getAttribute(key); }
public boolean hasAttribute(String key) { return commonInfo.hasAttribute(key); } public Object getAttribute(String key) { return commonInfo.getAttribute(key); }
public Object getAttribute(String key, Object defaultValue) { if ( hasAttribute(key) ) return attributes.get(key); else return defaultValue; }
public Object getAttribute(String key, Object defaultValue) { if ( hasAttribute(key) ) return attributes.get(key); else return defaultValue; }
public Object getAttribute(String key, Object defaultValue) { if ( hasAttribute(key) ) return attributes.get(key); else return defaultValue; }
public void putAttribute(String key, Object value, boolean allowOverwrites) { if ( ! allowOverwrites && hasAttribute(key) ) throw new IllegalStateException("Attempting to overwrite key->value binding: key = " + key + " this = " + this); if ( attributes == NO_ATTRIBUTES ) // immutable -> mutable attributes = new HashMap<String, Object>(); attributes.put(key, value); }
public void putAttribute(String key, Object value, boolean allowOverwrites) { if ( ! allowOverwrites && hasAttribute(key) ) throw new IllegalStateException("Attempting to overwrite key->value binding: key = " + key + " this = " + this); if ( attributes == NO_ATTRIBUTES ) // immutable -> mutable attributes = new HashMap<String, Object>(); attributes.put(key, value); }
public void putAttribute(String key, Object value, boolean allowOverwrites) { if ( ! allowOverwrites && hasAttribute(key) ) throw new IllegalStateException("Attempting to overwrite key->value binding: key = " + key + " this = " + this); if ( attributes == NO_ATTRIBUTES ) // immutable -> mutable attributes = new HashMap<String, Object>(); attributes.put(key, value); }
private final static Map<String, Object> subsetAttributes(final CommonInfo igc, final Collection<String> keysToPreserve) { Map<String, Object> attributes = new HashMap<>(keysToPreserve.size()); for ( final String key : keysToPreserve ) { if ( igc.hasAttribute(key) ) attributes.put(key, igc.getAttribute(key)); } return attributes; }