Class SirenConfiguration
- java.lang.Object
-
- de.ingogriebsch.spring.hateoas.siren.SirenConfiguration
-
public class SirenConfiguration extends Object
A Siren specific configuration that allows to configure specific parts of the library.- Since:
- 1.0.0
- Author:
- Ingo Griebsch
-
-
Constructor Summary
Constructors Constructor Description SirenConfiguration()
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description SirenConfigurationwithActionFieldTypeMappging(@NonNull Class<?> source, @NonNull SirenActionFieldType target)Deprecated.usewithActionFieldTypeMappging(Class, HtmlInputType)instead.SirenConfigurationwithActionFieldTypeMappging(@NonNull Class<?> source, @NonNull org.springframework.hateoas.mediatype.html.HtmlInputType target)Configures additional mappings that are used to convert the type of a payload field into a Siren action field type.SirenConfigurationwithEntityAndCollectionModelSubclassingEnabled(boolean enabled)Configures whether it is possible to subclassEntityModels andCollectionModels.SirenConfigurationwithObjectMapperCustomizer(@NonNull Consumer<com.fasterxml.jackson.databind.ObjectMapper> objectMapperCustomizer)Configures theObjectMapperinstance that is used for serialization.
-
-
-
Method Detail
-
withEntityAndCollectionModelSubclassingEnabled
public SirenConfiguration withEntityAndCollectionModelSubclassingEnabled(boolean enabled)
Configures whether it is possible to subclassEntityModels andCollectionModels. Defaults to false.- Parameters:
enabled- whether subclassing ofEntityModels andCollectionModels should be enabled or not.- Returns:
- the updated configuration reflecting the setting
-
withActionFieldTypeMappging
@Deprecated public SirenConfiguration withActionFieldTypeMappging(@NonNull @NonNull Class<?> source, @NonNull @NonNull SirenActionFieldType target)
Deprecated.usewithActionFieldTypeMappging(Class, HtmlInputType)instead.Configures additional mappings that are used to convert the type of a payload field into a Siren action field type.These mappings override the default mappings that are defined inside the library. The order of the defined mappings is important because the class hierarchy is taken into consideration.
- Parameters:
source- the type of the member that is part of the payload that is transformed into Siren action fields.target- thetypeof the Siren Action field that should represent the source type in the Siren representation.- Returns:
- the updated configuration reflecting the setting
-
withActionFieldTypeMappging
public SirenConfiguration withActionFieldTypeMappging(@NonNull @NonNull Class<?> source, @NonNull @NonNull org.springframework.hateoas.mediatype.html.HtmlInputType target)
Configures additional mappings that are used to convert the type of a payload field into a Siren action field type.These mappings override the default mappings that are defined inside the library. The order of the defined mappings is important because the class hierarchy is taken into consideration.
- Parameters:
source- the type of the member that is part of the payload that is transformed into Siren action fields.target- thetypeof the Siren Action field that should represent the source type in the Siren representation.- Returns:
- the updated configuration reflecting the setting
-
withObjectMapperCustomizer
public SirenConfiguration withObjectMapperCustomizer(@NonNull @NonNull Consumer<com.fasterxml.jackson.databind.ObjectMapper> objectMapperCustomizer)
Configures theObjectMapperinstance that is used for serialization.- Parameters:
objectMapperCustomizer- the customizer which is used to apply additional customizations to theObjectMapperinstance that is used for serialization.- Returns:
- the updated configuration reflecting the setting
-
-