Enum Class MethodConvention

java.lang.Object
java.lang.Enum<MethodConvention>
io.micronaut.core.naming.conventions.MethodConvention
All Implemented Interfaces:
Serializable, Comparable<MethodConvention>, Constable

public enum MethodConvention extends Enum<MethodConvention>

Represents the built in conventions for mapping a method name to an HTTP Method and URI.

Since:
1.0
Author:
Graeme Rocher
  • Enum Constant Details

    • INDEX

      public static final MethodConvention INDEX
      The index method of controllers.
    • SHOW

      public static final MethodConvention SHOW
      The show method of controllers.
    • SAVE

      public static final MethodConvention SAVE
      The show method of controllers.
    • UPDATE

      public static final MethodConvention UPDATE
      The default update method of controllers.
    • DELETE

      public static final MethodConvention DELETE
      The default delete method of controllers.
    • OPTIONS

      public static final MethodConvention OPTIONS
      The default options method of controllers.
    • TRACE

      public static final MethodConvention TRACE
      The default trace method of controllers.
  • Field Details

  • Method Details

    • values

      public static MethodConvention[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static MethodConvention valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null
    • uri

      public String uri()
      Returns:
      The default URI to map to if non is specified
    • httpMethod

      public String httpMethod()
      Returns:
      The HTTP method name for this convention.
    • methodName

      public String methodName()
      Returns:
      The method name for this convention
    • forMethod

      public static Optional<MethodConvention> forMethod(String name)
      Obtain the method convention for the given method.
      Parameters:
      name - The method name
      Returns:
      An optional of the method convention