Class Parameter

java.lang.Object
io.spring.initializr.generator.language.Parameter
All Implemented Interfaces:
Annotatable

public final class Parameter extends Object implements Annotatable
A parameter, typically of a method or function.
Author:
Andy Wilkinson, Stephane Nicoll
  • Method Details

    • of

      public static Parameter of(String name, String type)
      Create a parameter with the specified name and type.
      Parameters:
      name - the name of the parameter
      type - the type
      Returns:
      a parameter
    • of

      public static Parameter of(String name, ClassName type)
      Create a parameter with the specified name and type.
      Parameters:
      name - the name of the parameter
      type - the type
      Returns:
      a parameter
    • of

      public static Parameter of(String name, Class<?> type)
      Create a parameter with the specified name and type.
      Parameters:
      name - the name of the parameter
      type - the type
      Returns:
      a parameter
    • builder

      public static Parameter.Builder builder(String name)
      Initialize a builder for a parameter with the specified name.
      Parameters:
      name - the name of the parameter
      Returns:
      a builder to further configure the parameter
    • getName

      public String getName()
      Return the name of the parameter.
      Returns:
      the name
    • getType

      public String getType()
      Return the typ of the parameter.
      Returns:
      the type
    • annotations

      public AnnotationContainer annotations()
      Description copied from interface: Annotatable
      Return the AnnotationContainer to use to configure the annotations of this element.
      Specified by:
      annotations in interface Annotatable
      Returns:
      the annotation container