java.lang.Object
org.springframework.hateoas.server.mvc.MvcLink

public class MvcLink extends Object
Syntactic sugar to create Link instances from MvcUriComponentsBuilder invocations.
Author:
Oliver Drotbohm
  • Constructor Details

    • MvcLink

      public MvcLink()
  • Method Details

    • of

      public static Link of(Object invocation)
      Creates a new Link from the given MvcUriComponentsBuilder invocation defaulting to the IanaLinkRelations.SELF link relation.
      Parameters:
      invocation - must not be null.
      Returns:
      will never be null.
      Since:
      1.3
    • of

      public static Link of(Supplier<Object> invocation)
      Creates a new Link from the given lazy MvcUriComponentsBuilder invocation defaulting to the IanaLinkRelations.SELF link relation.
      Parameters:
      invocation - must not be null.
      Returns:
      will never be null.
      Since:
      1.3
    • of

      public static Link of(Object invocation, LinkRelation relation)
      Creates a new Link from the given MvcUriComponentsBuilder invocation.
      Parameters:
      invocation - must not be null.
      relation - must not be null.
      Returns:
      will never be null.
    • of

      public static Link of(Supplier<Object> invocation, LinkRelation relation)
      Creates a new Link from the given lazy MvcUriComponentsBuilder invocation.
      Parameters:
      invocation - must not be null.
      relation - must not be null.
      Returns:
      will never be null.
    • on

      public static <T> T on(Class<T> controller)
      Syntactic sugar for MvcUriComponentsBuilder.on(Class) to avoid the additional static import.
      Parameters:
      controller - must not be null.
      Returns:
      will never be null.
      Since:
      1.3