Class CachingMappingDiscoverer

java.lang.Object
org.springframework.hateoas.server.core.CachingMappingDiscoverer
All Implemented Interfaces:
MappingDiscoverer

public class CachingMappingDiscoverer extends Object implements MappingDiscoverer
Caching adapter of MappingDiscoverer.
Author:
Michal Stochmialek, Oliver Drotbohm, Réda Housni Alaoui
  • Method Details

    • of

      public static CachingMappingDiscoverer of(MappingDiscoverer delegate)
    • getUriMapping

      public @Nullable UriMapping getUriMapping(Class<?> type)
      Description copied from interface: MappingDiscoverer
      Returns the mapping associated with the given type.
      Specified by:
      getUriMapping in interface MappingDiscoverer
      Parameters:
      type - must not be null.
      Returns:
      the type-level mapping or null in case none is present.
    • getUriMapping

      public @Nullable UriMapping getUriMapping(Method method)
      Description copied from interface: MappingDiscoverer
      Returns the mapping associated with the given Method. This will include the type-level mapping.
      Specified by:
      getUriMapping in interface MappingDiscoverer
      Parameters:
      method - must not be null.
      Returns:
      the method mapping including the type-level one or null if neither of them present.
    • getUriMapping

      public @Nullable UriMapping getUriMapping(Class<?> type, Method method)
      Description copied from interface: MappingDiscoverer
      Returns the mapping for the given Method invoked on the given type. This can be used to calculate the mapping for a super type method being invoked on a sub-type with a type mapping.
      Specified by:
      getUriMapping in interface MappingDiscoverer
      Parameters:
      type - must not be null.
      method - must not be null.
      Returns:
      the method mapping including the type-level one or null if neither of them present.
    • getRequestMethod

      public Collection<org.springframework.http.HttpMethod> getRequestMethod(Class<?> type, Method method)
      Description copied from interface: MappingDiscoverer
      Returns the HTTP verbs for the given Method invoked on the given type. This can be used to build hypermedia templates.
      Specified by:
      getRequestMethod in interface MappingDiscoverer
      Returns:
    • getConsumes

      public List<org.springframework.http.MediaType> getConsumes(Method method)
      Description copied from interface: MappingDiscoverer
      Returns the MediaTypes supported for consumption.
      Specified by:
      getConsumes in interface MappingDiscoverer
      Parameters:
      method - must not be null.
      Returns:
      can be null.
    • getParams

      public String[] getParams(Method method)
      Description copied from interface: MappingDiscoverer
      Returns the statically declared request parameters.
      Specified by:
      getParams in interface MappingDiscoverer
      Parameters:
      method - must not be null.
      Returns:
      the parameters of the mapped request, narrowing the primary mapping.