Interface Endpoint<E extends Endpoint<E>>
- All Superinterfaces:
Copyable<E>,Serializable
- All Known Subinterfaces:
PageableEndpoint<E>
- All Known Implementing Classes:
AbstractEndpoint,DefaultEndpoint,DefaultPageableEndpoint
Represents the metadata for an endpoint.
- Author:
- Nick Crum (ncrum)
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic final classstatic enum -
Method Summary
Modifier and TypeMethodDescriptiondefault EExecutes the provided function with this endpoint as an argument.default EAdds an attributes with the provided key and value.default EClears the current conditions on this component.default Edefault Edefault Edefault Econditional(Conditional<?>... conditionals) Adds one or more conditions to this component.default Econditionals(List<Conditional<?>> conditionals) Adds one or more conditions to this component.default Edelete()findAttribute(String key) Finds the attribute at the given key.default <T> Optional<T>findAttribute(String key, Class<T> type) Finds the attribute at the given key.default Eget()default ObjectgetAttribute(String key) Retrieves the attribute at the given key.default <T> TgetAttribute(String key, Class<T> clazz) Retrieves the attribute at the given key and casts to the provided type.A key-value map used to provide additional metadata beyond the first-class properties.default List<Conditional<?>>A set of conditions used to indicate when this component should be rendered.Component<?>getScope()getType()getUri()default booleanhasAttribute(String key) Returns whether or not the attribute at the given key exists.default Edefault Edefault Edefault EmapParams(Collection<Mapping<?>> mappings) default Emethod(Endpoint.Method method) default Edefault Edefault Edefault Epatch()default Epost()default Eput()default EremoveAttribute(String key) Removes the attributes at the given key.default EremoveHeader(String name) default EremoveMapParam(String id) default EremoveParam(String name) default EConvenience method that is the same astreatAsPatch(true).default EresponseIsPartialState(boolean responseIsPartialState) Indicates that this endpoint's response will be a partial state that should be merged with the existing entity state, similar to a PATCH request.default Edefault Escopes(Collection<String> scopes) default Eself()Used internally to grab this endpoint cast toEndpoint.default voidsetAttributes(Map<String, Object> attributes) Sets the attributes map.default voidsetConditionals(List<Conditional<?>> conditionals) Sets the conditionals for this component.voidsetHeaders(Map<String, Object> headers) voidsetMapParams(List<Mapping<?>> mapParams) voidsetMethod(Endpoint.Method method) voidvoidvoidvoidsetTransformRequestBody(TransformBody transformRequestBody) voidsetTransformResponseBody(TransformBody transformResponseBody) voidvoiddefault EtransformRequest(TransformBody transformRequestBody) default Edefault EtransformResponse(TransformBody transformResponseBody) default Edefault Edefault E
-
Method Details
-
getType
-
getUri
-
getMethod
-
getScope
-
getParams
-
getHeaders
-
getMapParams
-
getTransformRequestBody
-
getTransformResponseBody
-
getParent
-
setType
-
setUri
-
setMethod
-
setScope
-
setParams
-
setHeaders
-
setMapParams
-
setTransformRequestBody
-
setTransformResponseBody
-
setParent
-
self
Used internally to grab this endpoint cast toEndpoint.- Returns:
- this
-
type
-
uri
-
method
-
method
-
get
-
post
-
put
-
patch
-
delete
-
scope
-
scopes
-
param
-
params
-
removeParam
-
clearParams
-
header
-
headers
-
removeHeader
-
clearHeaders
-
mapParam
-
mapParams
-
removeMapParam
-
clearParamMappings
-
transformRequest
-
transformRequest
-
transformResponse
-
transformResponse
-
apply
Executes the provided function with this endpoint as an argument.- Parameters:
fn- the function- Returns:
- this
- Since:
- Metadata 2.0.8, Release Train 2.1.6, 2.2.2
-
getAttributes
A key-value map used to provide additional metadata beyond the first-class properties. By default, this method returns a read-only empty map for backwards compatibility. Either extendAbstractEndpointor ensure that your implementation overrides this default method.- Returns:
- the attributes map
- Since:
- Metadata 2.0.8, Release Train 2.1.6, 2.2.2
-
setAttributes
Sets the attributes map. This is a no-op for backwards compatibility. Either extendAbstractEndpointor ensure that your implementation overrides this default method.- Parameters:
attributes- the attributes map- Since:
- Metadata 2.0.8, Release Train 2.1.6, 2.2.2
-
attribute
Adds an attributes with the provided key and value.- Parameters:
key- the keyvalue- the value- Returns:
- this
- Since:
- Metadata 2.0.8, Release Train 2.1.6, 2.2.2
-
removeAttribute
Removes the attributes at the given key.- Parameters:
key- the key- Returns:
- this
- Since:
- Metadata 2.0.8, Release Train 2.1.6, 2.2.2
-
hasAttribute
Returns whether or not the attribute at the given key exists.- Parameters:
key- the key- Returns:
- whether or not the attribute exists
- Since:
- Metadata 2.0.8, Release Train 2.1.6, 2.2.2
-
getAttribute
Retrieves the attribute at the given key.- Parameters:
key- the key- Returns:
- the attribute value
- Throws:
IllegalArgumentException- if no attribute exists at the key- Since:
- Metadata 2.0.8, Release Train 2.1.6, 2.2.2
-
getAttribute
Retrieves the attribute at the given key and casts to the provided type.- Type Parameters:
T- the type- Parameters:
key- the keyclazz- the type of attribute- Returns:
- the attribute value
- Since:
- Metadata 2.0.8, Release Train 2.1.6, 2.2.2
-
findAttribute
Finds the attribute at the given key. Null-safe version ofgetAttribute(String).- Parameters:
key- the key- Returns:
- an optional with the attribute value or empty
-
findAttribute
Finds the attribute at the given key. Null-safe version ofgetAttribute(String).- Parameters:
key- the key- Returns:
- an optional with the attribute value or empty
- Since:
- Metadata 2.0.8, Release Train 2.1.6, 2.2.2
-
responseIsPartialState
Indicates that this endpoint's response will be a partial state that should be merged with the existing entity state, similar to a PATCH request. This is useful for APIs that do not support PATCH requests directly or that are backing external field groups on a different entity's form. In those cases, the parent entity state should be merged with the new state returned by the endpoint to maintain the full view state.- Parameters:
responseIsPartialState- Whether the response is a partial state that should be merged with the existing entity state.- Returns:
- this
- Since:
- Metadata 2.0.8, Release Train 2.1.6, 2.2.2
- See Also:
-
responseIsPartialState
Convenience method that is the same astreatAsPatch(true).- Returns:
- this
- Since:
- Metadata 2.0.8, Release Train 2.1.6, 2.2.2
-
getConditionals
A set of conditions used to indicate when this component should be rendered. This is most commonly used by form components to hide/show fields and grids depending on the form state.- Returns:
- the set of conditionals
- Since:
- Metadata 2.0.8, Release Train 2.1.6, 2.2.2
-
setConditionals
Sets the conditionals for this component.- Parameters:
conditionals- the conditionals- Since:
- Metadata 2.0.8, Release Train 2.1.6, 2.2.2
-
conditional
Adds one or more conditions to this component.- Parameters:
conditionals- the condition(s)- Returns:
- this
- Since:
- Metadata 2.0.8, Release Train 2.1.6, 2.2.2
-
conditionals
Adds one or more conditions to this component.- Parameters:
conditionals- the condition(s)- Returns:
- this
- Since:
- Metadata 2.0.8, Release Train 2.1.6, 2.2.2
-
clearConditionals
Clears the current conditions on this component.- Returns:
- this
- Since:
- Metadata 2.0.8, Release Train 2.1.6, 2.2.2
-