Interface ICustomAttributeProviding
- All Known Subinterfaces:
ICustomAttributesEntity
- All Known Implementing Classes:
ClientFormTheme, Mandant, Projekt, Textbaustein, Vorgang
public interface ICustomAttributeProviding
Interface for object that provide custom attributes, i.e. key-value pairs that can be used to store additional
information. The stored data depends on the type of the object.
- Since:
- 8.3.0
- Author:
- XIMA MEDIA GmbH
-
Method Summary
Modifier and TypeMethodDescriptiondefault StringgetCustomAttribute(String key) Gets the value of the attribute with the given key.default <T> TgetCustomAttributeAs(String key, Function<String, ? extends T> converter) Gets the value of the attribute with the given key.default <T> TgetCustomAttributeAs(String key, Function<String, T> converter, T defaultValue) Gets the value of the attribute with the given key.default booleanGets the value of the attribute with the given key as a boolean.default doubleGets the value of the attribute with the given key as a double.default doublegetCustomAttributeDouble(String key, double defaultValue) Gets the value of the attribute with the given key as a double.default <E extends Enum<E>>
EgetCustomAttributeEnum(String key, Class<E> enumType) Gets the value of the attribute with the given key as an enum constant.default <E extends Enum<E>>
EgetCustomAttributeEnum(String key, Class<E> enumType, E defaultValue) Gets the value of the attribute with the given key as an enum constant.default intGets the value of the attribute with the given key as an integer.default intgetCustomAttributeInt(String key, int defaultValue) Gets the value of the attribute with the given key as an integer.default com.alibaba.fastjson.JSONArrayGets the value of the attribute with the given key as a JSON object.default com.alibaba.fastjson.JSONObjectGets the value of the attribute with the given key as a JSON object.default longGets the value of the attribute with the given key as a long.default longgetCustomAttributeLong(String key, long defaultValue) Gets the value of the attribute with the given key as a long.Gets the map of custom attributes that may be used to store additional information.default StringGets the value of the attribute with the given key as a string.default StringgetCustomAttributeString(String key, String defaultValue) Gets the value of the attribute with the given key as a string.default UUIDGets the value of the attribute with the given key as a UUID.
-
Method Details
-
getCustomAttribute
-
getCustomAttributeAs
Gets the value of the attribute with the given key.- Type Parameters:
T- Type of the attribute.- Parameters:
key- Name of the attribute.converter- Function to parse the string attribute value.- Returns:
- The value of the attribute, null if no such attribute exists or the attribute value could not be converted to the desired type.
-
getCustomAttributeAs
Gets the value of the attribute with the given key.- Type Parameters:
T- Type of the attribute.- Parameters:
key- Name of the attribute.converter- Function to parse the string attribute value.defaultValue- Default value to return if no value exists or the value could not be converted.- Returns:
- The value of the attribute, or the default value if no such attribute exists or the attribute value could not be converted to the desired type.
-
getCustomAttributeBoolean
Gets the value of the attribute with the given key as a boolean.- Parameters:
key- Name of the attribute.- Returns:
- The value of the attribute, false if no such attribute exists.
-
getCustomAttributeDouble
Gets the value of the attribute with the given key as a double.- Parameters:
key- Name of the attribute.- Returns:
- The value of the attribute, or 0 if no such attribute exists or the attribute value could not be converted to a double.
-
getCustomAttributeDouble
Gets the value of the attribute with the given key as a double.- Parameters:
key- Name of the attribute.defaultValue- Default value to return if no value exists, or the value is not a valid double.- Returns:
- The value of the attribute, or the default value if no such attribute exists or the attribute value could not be converted to a double.
-
getCustomAttributeEnum
Gets the value of the attribute with the given key as an enum constant.- Type Parameters:
E- Type of the enum.- Parameters:
key- Name of the attribute.enumType- Type of the enum.- Returns:
- The value of the attribute, or 0 if no such attribute exists or the attribute value could not be converted to an enum constant.
-
getCustomAttributeEnum
Gets the value of the attribute with the given key as an enum constant.- Type Parameters:
E- Type of the enum.- Parameters:
key- Name of the attribute.enumType- Type of the enum.defaultValue- Default value to return if no value exists, or the value is not a valid enum constant.- Returns:
- The value of the attribute, or the default value if no such attribute exists or the attribute value could not be converted to an enum constant.
-
getCustomAttributeInt
Gets the value of the attribute with the given key as an integer.- Parameters:
key- Name of the attribute.- Returns:
- The value of the attribute, or 0 if no such attribute exists or the attribute value could not be converted to an integer.
-
getCustomAttributeInt
Gets the value of the attribute with the given key as an integer.- Parameters:
key- Name of the attribute.defaultValue- Default value to return if no value exists, or the value is not a valid integer.- Returns:
- The value of the attribute, or the default value if no such attribute exists or the attribute value could not be converted to an integer.
-
getCustomAttributeJsonArray
Gets the value of the attribute with the given key as a JSON object.- Parameters:
key- Name of the attribute.- Returns:
- The value of the attribute, or empty JSON object if no such attribute exists or the attribute value could not be parsed as a JSON object.
-
getCustomAttributeJsonObject
Gets the value of the attribute with the given key as a JSON object.- Parameters:
key- Name of the attribute.- Returns:
- The value of the attribute, or empty JSON object if no such attribute exists or the attribute value could not be parsed as a JSON object.
-
getCustomAttributeLong
Gets the value of the attribute with the given key as a long.- Parameters:
key- Name of the attribute.- Returns:
- The value of the attribute, or 0 if no such attribute exists or the attribute value could not be converted to a long.
-
getCustomAttributeLong
Gets the value of the attribute with the given key as a long.- Parameters:
key- Name of the attribute.defaultValue- Default value to return if no value exists, or the value is not a valid long.- Returns:
- The value of the attribute, or the default value if no such attribute exists or the attribute value could not be converted to a long.
-
getCustomAttributeString
-
getCustomAttributeString
Gets the value of the attribute with the given key as a string.- Parameters:
key- Name of the attribute.defaultValue- Default value to return if no value exists.- Returns:
- The value of the attribute, or the default value if no such attribute exists, or the attribute value is empty.
-
getCustomAttributeUuid
-
getCustomAttributes
-