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
Nested ClassesModifier and TypeClassDescriptionstatic interfacePayload metadata for incoming requests.static interfaceA named component.static interfaceMetadata about payloads.static interfaceMetadata about the property model of a representation.static interfaceSPI for a type that can getAffordanceModel.PropertyMetadataapplied. -
Constructor Summary
ConstructorsConstructorDescriptionAffordanceModel(String name, Link link, org.springframework.http.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 aListof properties based on the given creator.booleanorg.springframework.http.HttpMethodgetInput()getLink()getName()getURI()Expand theLinkinto an href with no parameters.inthashCode()booleanhasHttpMethod(org.springframework.http.HttpMethod method) Returns whether theAffordancehas the givenHttpMethod.booleanpointsToTargetOf(Link link) Returns whether theAffordancepoints to the target of the givenLink.
-
Constructor Details
-
AffordanceModel
public AffordanceModel(String name, Link link, org.springframework.http.HttpMethod httpMethod, AffordanceModel.InputPayloadMetadata input, List<QueryParameter> queryMethodParameters, AffordanceModel.PayloadMetadata output)
-
-
Method Details
-
getURI
Expand theLinkinto an href with no parameters.- Returns:
-
hasHttpMethod
public boolean hasHttpMethod(org.springframework.http.HttpMethod method) Returns whether theAffordancehas the givenHttpMethod.- Parameters:
method- must not be null.- Returns:
-
pointsToTargetOf
Returns whether theAffordancepoints to the target of the givenLink.- Parameters:
link- must not be null.- Returns:
-
getName
-
getLink
-
getHttpMethod
public org.springframework.http.HttpMethod getHttpMethod() -
getInput
-
getQueryMethodParameters
-
getOutput
-
createProperties
public <T> List<T> createProperties(BiFunction<AffordanceModel.InputPayloadMetadata, AffordanceModel.PropertyMetadata, T> creator) Creates aListof properties based on the given creator.- Type Parameters:
T- the property type- Parameters:
creator- a creator function that turns anAffordanceModel.InputPayloadMetadataandAffordanceModel.PropertyMetadatainto a property instance.- Returns:
- will never be null.
- Since:
- 1.3
-
equals
-
hashCode
public int hashCode()
-