public class DefaultAttributeValueRegistryImpl extends Object implements DefaultAttributeValueRegistry
Constructor and Description |
---|
DefaultAttributeValueRegistryImpl() |
Modifier and Type | Method and Description |
---|---|
Optional<Serializable> |
getDefaultValue(String metacardTypeName,
String attributeName)
Retrieves the default value registered for the given attribute of the given metacard type.
|
void |
removeDefaultValue(String attributeName)
Removes the default value for the given attribute.
|
void |
removeDefaultValue(String metacardTypeName,
String attributeName)
Removes the default value for the given attribute of the given metacard type.
|
void |
removeDefaultValues()
Removes all 'global' default values (i.e., the default values for the attributes that are not
tied to specific metacard types).
|
void |
removeDefaultValues(String metacardTypeName)
Removes all the default attribute values for the given metacard type.
|
void |
setDefaultValue(String attributeName,
Serializable defaultValue)
Registers the given value as the default value for the given attribute across all metacard
types (i.e., it is a 'global' default value).
|
void |
setDefaultValue(String metacardTypeName,
String attributeName,
Serializable defaultValue)
Registers the given value as the default value for the given attribute of the given metacard
type.
|
public void setDefaultValue(String attributeName, Serializable defaultValue)
DefaultAttributeValueRegistry
setDefaultValue
in interface DefaultAttributeValueRegistry
attributeName
- the name of the attribute, cannot be nulldefaultValue
- the default value, cannot be nullpublic void setDefaultValue(String metacardTypeName, String attributeName, Serializable defaultValue)
DefaultAttributeValueRegistry
setDefaultValue
in interface DefaultAttributeValueRegistry
metacardTypeName
- the name of the metacard type, cannot be nullattributeName
- the name of the attribute belonging to the metacard type, cannot be nulldefaultValue
- the default value, cannot be nullpublic Optional<Serializable> getDefaultValue(String metacardTypeName, String attributeName)
DefaultAttributeValueRegistry
In the event that an attribute has a 'global' default value as well as a default value for the given metacard type, the default value for the given metacard type will be returned (i.e., the more specific default value wins). If the attribute has a 'global' default value but no default value for the given metacard type, then the 'global' default value will be returned.
getDefaultValue
in interface DefaultAttributeValueRegistry
metacardTypeName
- the name of the metacard type, cannot be nullattributeName
- the name of the attribute belonging to the metacard type, cannot be nullOptional
containing the default value registered for the given attribute of
the given metacard type, or Optional.empty()
if the attribute does not have a
default value registeredpublic void removeDefaultValue(String attributeName)
DefaultAttributeValueRegistry
removeDefaultValue
in interface DefaultAttributeValueRegistry
attributeName
- the name of the attribute whose default value will be removed, cannot be
nullpublic void removeDefaultValue(String metacardTypeName, String attributeName)
DefaultAttributeValueRegistry
removeDefaultValue
in interface DefaultAttributeValueRegistry
metacardTypeName
- the name of the metacard type, cannot be nullattributeName
- the name of the attribute whose default value will be removed, cannot be
nullpublic void removeDefaultValues()
DefaultAttributeValueRegistry
removeDefaultValues
in interface DefaultAttributeValueRegistry
public void removeDefaultValues(String metacardTypeName)
DefaultAttributeValueRegistry
removeDefaultValues
in interface DefaultAttributeValueRegistry
metacardTypeName
- the name of the metacard type whose default attribute values will be
removed, cannot be nullThis work is licensed under a Creative Commons Attribution 4.0 International License.