Class MethodParameters

java.lang.Object
org.springframework.hateoas.server.core.MethodParameters

public class MethodParameters extends Object
Value object to represent MethodParameters to allow to easily find the ones with a given annotation.
Author:
Oliver Gierke
  • Constructor Details

    • MethodParameters

      public MethodParameters(Method method, @Nullable AnnotationAttribute namingAnnotation)
      Creates a new MethodParameters for the given Method and AnnotationAttribute. If the latter is given, method parameter names will be looked up from the annotation attribute if present.
      Parameters:
      method - must not be null.
      namingAnnotation - can be null.
  • Method Details

    • of

      public static MethodParameters of(Method method)
      Returns the MethodParameters for the given Method.
      Parameters:
      method - must not be null.
      Returns:
    • getParameters

      public List<org.springframework.core.MethodParameter> getParameters()
      Returns all MethodParameters.
      Returns:
    • getParameter

      public Optional<org.springframework.core.MethodParameter> getParameter(String name)
      Returns the MethodParameter with the given name or null if none found.
      Parameters:
      name - must not be null or empty.
      Returns:
    • getParametersOfType

      public List<org.springframework.core.MethodParameter> getParametersOfType(Class<?> type)
      Returns all parameters of the given type.
      Parameters:
      type - must not be null.
      Returns:
      Since:
      0.9
    • getParametersWith

      public List<org.springframework.core.MethodParameter> getParametersWith(Class<? extends Annotation> annotation)
      Returns all MethodParameters annotated with the given annotation type.
      Parameters:
      annotation - must not be null.
      Returns: