Class Annotation.BuilderBase<BUILDER extends Annotation.BuilderBase<BUILDER,PROTOTYPE>,PROTOTYPE extends Annotation>

java.lang.Object
io.helidon.common.types.Annotation.BuilderBase<BUILDER,PROTOTYPE>
Type Parameters:
BUILDER - type of the builder extending this abstract builder
PROTOTYPE - type of the prototype interface that would be built by Prototype.Builder.buildPrototype()
All Implemented Interfaces:
Prototype.Builder<BUILDER,PROTOTYPE>
Direct Known Subclasses:
Annotation.Builder
Enclosing interface:
Annotation

public abstract static class Annotation.BuilderBase<BUILDER extends Annotation.BuilderBase<BUILDER,PROTOTYPE>,PROTOTYPE extends Annotation> extends Object implements Prototype.Builder<BUILDER,PROTOTYPE>
Fluent API builder base for Annotation.
  • Constructor Details

    • BuilderBase

      protected BuilderBase()
      Protected to support extensibility.
  • Method Details

    • from

      public BUILDER from(Annotation prototype)
      Update this builder from an existing prototype instance.
      Parameters:
      prototype - existing prototype to update this builder from
      Returns:
      updated builder instance
    • from

      public BUILDER from(Annotation.BuilderBase<?,?> builder)
      Update this builder from an existing prototype builder instance.
      Parameters:
      builder - existing builder prototype to update this builder from
      Returns:
      updated builder instance
    • type

      public BUILDER type(Type annoType)
      Annotation type name from annotation type.
      Parameters:
      annoType - annotation class
      Returns:
      updated builder instance
    • value

      public BUILDER value(String value)
      Configure the value of this annotation (property of name value).
      Parameters:
      value - value of the annotation
      Returns:
      updated builder instance
    • typeName

      public BUILDER typeName(TypeName typeName)
      The type name, e.g., Objects -> "java.util.Objects".
      Parameters:
      typeName - the annotation type name
      Returns:
      updated builder instance
      See Also:
    • typeName

      public BUILDER typeName(Consumer<TypeName.Builder> consumer)
      The type name, e.g., Objects -> "java.util.Objects".
      Parameters:
      consumer - consumer of builder for the annotation type name
      Returns:
      updated builder instance
      See Also:
    • typeName

      public BUILDER typeName(Supplier<? extends TypeName> supplier)
      The type name, e.g., Objects -> "java.util.Objects".
      Parameters:
      supplier - supplier of the annotation type name
      Returns:
      updated builder instance
      See Also:
    • values

      public BUILDER values(Map<? extends String,?> values)
      This method replaces all values with the new ones.
      Parameters:
      values - key-value pairs of all the properties present
      Returns:
      updated builder instance
      See Also:
    • addValues

      public BUILDER addValues(Map<? extends String,?> values)
      This method keeps existing values, then puts all new values into the map.
      Parameters:
      values - key-value pairs of all the properties present
      Returns:
      updated builder instance
      See Also:
    • putValue

      public BUILDER putValue(String key, Object value)
      This method adds a new value to the map, or replaces it if the key already exists.
      Parameters:
      key - key to add or replace
      value - new value for the key
      Returns:
      updated builder instance
      See Also:
    • typeName

      public Optional<TypeName> typeName()
      The type name, e.g., Objects -> "java.util.Objects".
      Returns:
      the type name
    • values

      public Map<String,Object> values()
      Get a key-value of all the annotation properties.
      Returns:
      the values
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • preBuildPrototype

      protected void preBuildPrototype()
      Handles providers and decorators.
    • validatePrototype

      protected void validatePrototype()
      Validates required properties.