Interface SirenActionFieldTypeConverter
-
public interface SirenActionFieldTypeConverterSPI to convert a property that is part of anAffordanceModeland the type of the surrounding Siren action into aSirenActionFieldType.- Since:
- 1.0.0
- Author:
- Ingo Griebsch
- See Also:
SirenActionFieldType, Siren Action Field Type, Siren Action Type
-
-
Field Summary
Fields Modifier and Type Field Description static SirenActionFieldTypeConverterDEFAULT_INSTANCEThe default instance that can be used if no specific implementation of this interface is necessary.
-
Method Summary
All Methods Instance Methods Default Methods Deprecated Methods Modifier and Type Method Description default SirenActionFieldTypeconvert(@NonNull org.springframework.hateoas.AffordanceModel.PropertyMetadata fieldMetadata, @NonNull org.springframework.http.MediaType actionType)Deprecated.useexecute(PropertyMetadata, MediaType)instead.default Optional<org.springframework.hateoas.mediatype.html.HtmlInputType>execute(@NonNull org.springframework.hateoas.AffordanceModel.PropertyMetadata fieldMetadata, @NonNull org.springframework.http.MediaType actionType)Converts the givenproperty metadataand thetypeof the respective Siren action into aHtmlInputType, if possible.
-
-
-
Field Detail
-
DEFAULT_INSTANCE
static final SirenActionFieldTypeConverter DEFAULT_INSTANCE
The default instance that can be used if no specific implementation of this interface is necessary.
-
-
Method Detail
-
convert
@Deprecated default SirenActionFieldType convert(@NonNull @NonNull org.springframework.hateoas.AffordanceModel.PropertyMetadata fieldMetadata, @NonNull @NonNull org.springframework.http.MediaType actionType)
Deprecated.useexecute(PropertyMetadata, MediaType)instead.Converts the givenproperty metadataand thetypeof the respective Siren action into aSirenActionFieldType.The default implementation always returns the fallback, as specified through the specification.
- Parameters:
fieldMetadata- the metadata of the property. Is never null.actionType- the type of the action. Is never null.- Returns:
- the matching
SirenActionFieldType.
-
execute
default Optional<org.springframework.hateoas.mediatype.html.HtmlInputType> execute(@NonNull @NonNull org.springframework.hateoas.AffordanceModel.PropertyMetadata fieldMetadata, @NonNull @NonNull org.springframework.http.MediaType actionType)
Converts the givenproperty metadataand thetypeof the respective Siren action into aHtmlInputType, if possible.The default implementation always returns the fallback, as specified through the specification.
- Parameters:
fieldMetadata- the metadata of the property. Is never null.actionType- the type of the action. Is never null.- Returns:
- the matching
HtmlInputTypeor an emptyOptional.
-
-