Package de.espirit.firstspirit.ai.dto
Interface AttributeProvider
@Experimental
public interface AttributeProvider
Provides generic attributes configured for this object.
The attributes available may depend on the configured
GenerativeAIConnectorPlugin
.- Since:
- 5.2.240708
-
Method Summary
Modifier and TypeMethodDescription@NotNull Optional<Serializable>
getAttribute
(@NotNull String name) Returns the value of the given attribute, or empty.default <T> @NotNull Optional<T>
getAttribute
(@NotNull String name, @NotNull Class<T> type) Returns the value of the given attribute if it matches the given type, or empty if not found or incompatible.getAttributeBoolean
(@NotNull String name) Returns the boolean value of the given attribute, or empty if not of typeBoolean
.getAttributeDouble
(@NotNull String name) Returns the double value of the given attribute, or empty if not a number.getAttributeFloat
(@NotNull String name) Returns the float value of the given attribute, or empty if not a number.getAttributeInteger
(@NotNull String name) Returns the integer value of the given attribute, or empty if not a number.getAttributeLong
(@NotNull String name) Returns the long value of the given attribute, or empty if not a number.getAttributeString
(@NotNull String name) Returns the string value of the given attribute, or empty if not of typeString
.
-
Method Details
-
getAttribute
Returns the value of the given attribute, or empty.- Parameters:
name
- The name of the attribute.- Returns:
- The attribute value, or empty.
- Since:
- 5.2.240708
-
getAttribute
@NotNull default <T> @NotNull Optional<T> getAttribute(@NotNull @NotNull String name, @NotNull @NotNull Class<T> type) Returns the value of the given attribute if it matches the given type, or empty if not found or incompatible.- Parameters:
name
- The name of the attribute.type
- The expected value type.- Returns:
- The attribute value, or empty.
- Since:
- 5.2.240708
-
getAttributeBoolean
Returns the boolean value of the given attribute, or empty if not of typeBoolean
.- Parameters:
name
- The name of the attribute.- Returns:
- The attribute value, or empty.
- Since:
- 5.2.240708
-
getAttributeString
Returns the string value of the given attribute, or empty if not of typeString
.- Parameters:
name
- The name of the attribute.- Returns:
- The attribute value, or empty.
- Since:
- 5.2.240708
-
getAttributeInteger
Returns the integer value of the given attribute, or empty if not a number.- Parameters:
name
- The name of the attribute.- Returns:
- The attribute value, or empty.
- Since:
- 5.2.240708
-
getAttributeLong
Returns the long value of the given attribute, or empty if not a number.- Parameters:
name
- The name of the attribute.- Returns:
- The attribute value, or empty.
- Since:
- 5.2.240708
-
getAttributeFloat
Returns the float value of the given attribute, or empty if not a number.- Parameters:
name
- The name of the attribute.- Returns:
- The attribute value, or empty.
- Since:
- 5.2.240708
-
getAttributeDouble
Returns the double value of the given attribute, or empty if not a number.- Parameters:
name
- The name of the attribute.- Returns:
- The attribute value, or empty.
- Since:
- 5.2.240708
-