Class Annotation.Builder

java.lang.Object
io.spring.initializr.generator.language.Annotation.Builder
Enclosing class:
Annotation

public static final class Annotation.Builder extends Object
Builder for creating an Annotation.
  • Method Details

    • attribute

      @Deprecated(since="0.22.0", forRemoval=true) public Annotation.Builder attribute(String name, Class<?> type, String... values)
      Deprecated, for removal: This API element is subject to removal in a future version.
      as of 0.22.0 in favor of set(String, Object...)
      Set the attribute with the specified name and String representation of the specified values.
      Parameters:
      name - the name of the attribute
      type - the type of the property
      values - the values to associate with the attribute
      Returns:
      this for method chaining
    • set

      public Annotation.Builder set(String name, Object... values)
      Set the attribute with the specified name with the specified values. If the attribute exists, it is replaced by the specified values.
      Parameters:
      name - the name of the attribute
      values - the values to associate with the attribute
      Returns:
      this for method chaining
    • add

      public Annotation.Builder add(String name, Object... values)
      Add the specified values to the attribute with the specified name. If the attribute does not exist, it is created with the specified values.
      Parameters:
      name - the name of the attribute
      values - the values to add to the attribute
      Returns:
      this for method chaining
    • from

      public Annotation.Builder from(Annotation annotation)
      Reset the state of the builder to the state of the specified annotation. This effectively replaces all customizations by the specified annotation.
      Parameters:
      annotation - the annotation to reset to
      Returns:
      this for method chaining
    • build

      public Annotation build()