Class LinkRelationProvider.LookupContext

java.lang.Object
org.springframework.hateoas.server.LinkRelationProvider.LookupContext
Enclosing interface:
LinkRelationProvider

public static class LinkRelationProvider.LookupContext extends Object
LinkRelationProvider selection context for item resource relation lookups (forItemResourceRelLookup(Class), collection resource relation lookups forCollectionResourceRelLookup(Class) or both forType(Class).
Author:
Oliver Drotbohm
  • Method Details

    • getType

      public Class<?> getType()
    • forType

      public static LinkRelationProvider.LookupContext forType(Class<?> type)
      Creates a LinkRelationProvider.LookupContext for the type in general, i.e. both item and collection relation lookups.
      Parameters:
      type - must not be null.
      Returns:
    • forItemResourceRelLookup

      public static LinkRelationProvider.LookupContext forItemResourceRelLookup(Class<?> type)
      Creates a LinkRelationProvider.LookupContext to lookup the item resource relation for the given type.
      Parameters:
      type - must not be null.
      Returns:
    • forCollectionResourceRelLookup

      public static LinkRelationProvider.LookupContext forCollectionResourceRelLookup(Class<?> type)
      Creates a LinkRelationProvider.LookupContext to lookup the collection resource relation for the given type.
      Parameters:
      type - must not be null.
      Returns:
    • isItemRelationLookup

      public boolean isItemRelationLookup()
      Returns whether the current context includes the item relation lookup.
      Returns:
    • isCollectionRelationLookup

      public boolean isCollectionRelationLookup()
      Returns whether the current context includes the collection relation lookup.
      Returns:
    • handlesType

      public boolean handlesType(Class<?> type)
      Returns whether the lookup is executed for the given type.
      Parameters:
      type - must not be null.
      Returns:
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object