Interface LinkRelation

All Known Implementing Classes:
HalLinkRelation

public interface LinkRelation
Interface for defining link relations. Can be used for implementing spec-based link relations as well as custom ones.
Since:
1.0
Author:
Greg Turnquist, Oliver Drotbohm
  • Method Details

    • value

      String value()
      Return the link relation's value.
    • of

      static LinkRelation of(String relation)
      Creates a new LinkRelation.
      Parameters:
      relation - must not be null or empty.
      Returns:
    • manyOf

      static Iterable<LinkRelation> manyOf(String... others)
      Creates a new Iterable of LinkRelation for each of the given Strings.
      Parameters:
      others - must not be null.
      Returns:
    • isSameAs

      default boolean isSameAs(LinkRelation relation)
      Returns whether the given LinkRelation is logically the same as the current one, independent of implementation, i.e. whether the plain String values match.
      Parameters:
      relation - must not be null.
      Returns:
    • map

      default LinkRelation map(Function<String,String> mapper)
      Returns a new LinkRelation with its relation mapped by the given function, unless it is an IANA one. Implementors are encouraged to override this method to redeclare the return type to be itself.
      Parameters:
      mapper - must not be null.
      Returns:
      See Also: