Class SimpleResourceDescription
java.lang.Object
org.springframework.data.rest.core.mapping.ResolvableResourceDescriptionSupport
org.springframework.data.rest.core.mapping.SimpleResourceDescription
- All Implemented Interfaces:
MessageSourceResolvable
,ResourceDescription
- Direct Known Subclasses:
TypedResourceDescription
- Author:
- Oliver Gierke
-
Field Summary
-
Constructor Summary
ModifierConstructorDescriptionprotected
SimpleResourceDescription
(String message, MediaType mediaType) Creates a newSimpleResourceDescription
with the given message andMediaType
. -
Method Summary
Modifier and TypeMethodDescriptionstatic ResourceDescription
defaultFor
(LinkRelation rel) String[]
getCodes()
Returns the description.getType()
boolean
Returns whether this is the default description.Methods inherited from class org.springframework.data.rest.core.mapping.ResolvableResourceDescriptionSupport
getArguments, getDefaultMessage
-
Field Details
-
DEFAULT_KEY_PREFIX
- See Also:
-
DEFAULT_MEDIA_TYPE
-
-
Constructor Details
-
SimpleResourceDescription
Creates a newSimpleResourceDescription
with the given message andMediaType
.- Parameters:
message
- must not be null or empty.mediaType
- must not be null or empty.
-
-
Method Details
-
defaultFor
-
getMessage
Description copied from interface:ResourceDescription
Returns the description. This can be a message source code or a custom text format. Prefer resolving theResourceDescription
using aMessageSource
.- Returns:
-
getType
-
isDefault
public boolean isDefault()Description copied from interface:ResourceDescription
Returns whether this is the default description.- Returns:
-
getCodes
-