/** * Obtains the current value of the specified property. If the property has * a value specified, that value will be used. If not the default value of * the property will be used. If the property is not known, <code>null</code> * will be returned. * * @param name the name of the property * * @return an {@link Object} */ public Object getProperty(String name) { if (properties.containsKey(name)) { Property property = properties.get(name); return property.hasValue() ? property.getValue() : property.getDefaultValue(); } else { return null; } }
/** * Constructs a {@link Property} based on another {@link Property}. * * @param property the {@link Property} from which to construct * (copy) the new {@link Property} */ public Property(Property property) { this.name = property.getName(); this.value = property.getValue(); this.defaultValue = property.getDefaultValue(); }