Package org.springframework.hateoas
Class AffordanceModel
java.lang.Object
org.springframework.hateoas.AffordanceModel
Collection of attributes needed to render any form of hypermedia.
- Author:
- Greg Turnquist, Oliver Drotbohm
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic interface
Payload metadata for incoming requests.static interface
A named component.static interface
Metadata about payloads.static interface
Metadata about the property model of a representation.static interface
SPI for a type that can getAffordanceModel.PropertyMetadata
applied. -
Constructor Summary
ConstructorDescriptionAffordanceModel
(String name, Link link, HttpMethod httpMethod, AffordanceModel.InputPayloadMetadata input, List<QueryParameter> queryMethodParameters, AffordanceModel.PayloadMetadata output) -
Method Summary
Modifier and TypeMethodDescription<T> List<T>
createProperties
(BiFunction<AffordanceModel.InputPayloadMetadata, AffordanceModel.PropertyMetadata, T> creator) Creates aList
of properties based on the given creator.boolean
getInput()
getLink()
getName()
getURI()
Expand theLink
into an href with no parameters.int
hashCode()
boolean
hasHttpMethod
(HttpMethod method) Returns whether theAffordance
has the givenHttpMethod
.boolean
pointsToTargetOf
(Link link) Returns whether theAffordance
points to the target of the givenLink
.
-
Constructor Details
-
AffordanceModel
public AffordanceModel(String name, Link link, HttpMethod httpMethod, AffordanceModel.InputPayloadMetadata input, List<QueryParameter> queryMethodParameters, AffordanceModel.PayloadMetadata output)
-
-
Method Details
-
getURI
Expand theLink
into an href with no parameters.- Returns:
-
hasHttpMethod
Returns whether theAffordance
has the givenHttpMethod
.- Parameters:
method
- must not be null.- Returns:
-
pointsToTargetOf
Returns whether theAffordance
points to the target of the givenLink
.- Parameters:
link
- must not be null.- Returns:
-
getName
-
getLink
-
getHttpMethod
-
getInput
-
getQueryMethodParameters
-
getOutput
-
createProperties
public <T> List<T> createProperties(BiFunction<AffordanceModel.InputPayloadMetadata, AffordanceModel.PropertyMetadata, T> creator) Creates aList
of properties based on the given creator.- Type Parameters:
T
- the property type- Parameters:
creator
- a creator function that turns anAffordanceModel.InputPayloadMetadata
andAffordanceModel.PropertyMetadata
into a property instance.- Returns:
- will never be null.
- Since:
- 1.3
-
equals
-
hashCode
public int hashCode()
-