Class Parameter.Builder

java.lang.Object
be.imgn.gaia.processing.source.Parameter.Builder
Enclosing class:
Parameter

public static final class Parameter.Builder extends Object
A builder of Parameters.
  • Method Details

    • addModifiers

      public Parameter.Builder addModifiers(Modifier... more)
      Adds modifiers.
      Parameters:
      more - the modifiers: only final is allowed, and none on a receiver parameter
      Returns:
      this builder
      Throws:
      IllegalArgumentException - if a modifier is not final or is repeated, or this is a receiver parameter
    • addModifiers

      public Parameter.Builder addModifiers(Iterable<Modifier> more)
      Adds modifiers.
      Parameters:
      more - the modifiers: only final is allowed, and none on a receiver parameter
      Returns:
      this builder
      Throws:
      IllegalArgumentException - if a modifier is not final or is repeated, or this is a receiver parameter
    • addAnnotation

      public Parameter.Builder addAnnotation(Annotation annotation)
      Adds a declaration annotation. A type annotation, such as @Nullable, goes on the type instead.
      Parameters:
      annotation - the annotation
      Returns:
      this builder
    • addAnnotation

      public Parameter.Builder addAnnotation(Class<? extends Annotation> annotation)
      Adds a declaration annotation without members.
      Parameters:
      annotation - the annotation type
      Returns:
      this builder
      Throws:
      IllegalArgumentException - if the class is not an annotation type
    • addAnnotation

      public Parameter.Builder addAnnotation(ClassName annotation)
      Adds a declaration annotation without members.
      Parameters:
      annotation - the annotation type
      Returns:
      this builder
    • addAnnotations

      public Parameter.Builder addAnnotations(Iterable<Annotation> more)
      Adds declaration annotations.
      Parameters:
      more - the annotations
      Returns:
      this builder
    • addJavadoc

      public Parameter.Builder addJavadoc(String format, @Nullable Object... args)
      Adds Javadoc text, written as an @param tag in the Javadoc of the method or record. End each line with \n.
      Parameters:
      format - the text, with placeholders
      args - the arguments of the placeholders
      Returns:
      this builder
      Throws:
      IllegalArgumentException - if the format and the arguments do not match
    • addJavadoc

      public Parameter.Builder addJavadoc(CodeBlock text)
      Adds Javadoc text, written as an @param tag in the Javadoc of the method or record. End each line with \n.
      Parameters:
      text - the text
      Returns:
      this builder
    • build

      public Parameter build()
      Builds the parameter.
      Returns:
      the parameter
      Throws:
      IllegalStateException - if the Javadoc is not balanced