Package io.micronaut.core.attr
Interface AttributeHolder
-
- All Known Subinterfaces:
MutableAttributeHolder
public interface AttributeHolder
An interface for objects that have attributes.- Since:
- 1.0
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default java.util.Optional<java.lang.Object>
getAttribute(java.lang.CharSequence name)
Obtain the value of an attribute on the HTTP method.default <T> java.util.Optional<T>
getAttribute(java.lang.CharSequence name, java.lang.Class<T> type)
Obtain the value of an attribute on the HTTP method.ConvertibleValues<java.lang.Object>
getAttributes()
AMutableConvertibleValues
of the attributes for object.
-
-
-
Method Detail
-
getAttributes
@NonNull ConvertibleValues<java.lang.Object> getAttributes()
A
MutableConvertibleValues
of the attributes for object.- Returns:
- The attributes of the object
-
getAttribute
@NonNull default java.util.Optional<java.lang.Object> getAttribute(java.lang.CharSequence name)
Obtain the value of an attribute on the HTTP method.- Parameters:
name
- The name of the attribute- Returns:
- An
Optional
value
-
getAttribute
@NonNull default <T> java.util.Optional<T> getAttribute(java.lang.CharSequence name, java.lang.Class<T> type)
Obtain the value of an attribute on the HTTP method.- Type Parameters:
T
- type Generic- Parameters:
name
- The name of the attributetype
- The required type- Returns:
- An
Optional
value
-
-