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

java.lang.Object
io.helidon.declarative.codegen.model.http.ModelElement.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:
HttpAnnotated.BuilderBase, ModelElement.Builder, RestMethodParameter.BuilderBase
Enclosing interface:
ModelElement

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

    • BuilderBase

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

    • from

      public BUILDER from(ModelElement prototype)
      Update this builder from an existing prototype instance. This method disables automatic service discovery.
      Parameters:
      prototype - existing prototype to update this builder from
      Returns:
      updated builder instance
    • from

      public BUILDER from(ModelElement.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
    • annotations

      public BUILDER annotations(Set<? extends Annotation> annotations)
      All annotations on this element, and inherited from supertype/interface and annotations.
      Parameters:
      annotations - annotations
      Returns:
      updated builder instance
      See Also:
    • addAnnotations

      public BUILDER addAnnotations(Set<? extends Annotation> annotations)
      All annotations on this element, and inherited from supertype/interface and annotations.
      Parameters:
      annotations - annotations
      Returns:
      updated builder instance
      See Also:
    • addAnnotation

      public BUILDER addAnnotation(Annotation annotation)
      All annotations on this element, and inherited from supertype/interface and annotations.
      Parameters:
      annotation - annotations
      Returns:
      updated builder instance
      See Also:
    • addAnnotation

      public BUILDER addAnnotation(Consumer<Annotation.Builder> consumer)
      All annotations on this element, and inherited from supertype/interface and annotations.
      Parameters:
      consumer - annotations
      Returns:
      updated builder instance
      See Also:
    • type

      public BUILDER type(TypeInfo type)
      Type of this element.
      Parameters:
      type - type info
      Returns:
      updated builder instance
      See Also:
    • type

      public BUILDER type(Consumer<TypeInfo.Builder> consumer)
      Type of this element.
      Parameters:
      consumer - consumer of builder for type info
      Returns:
      updated builder instance
      See Also:
    • type

      public BUILDER type(Supplier<? extends TypeInfo> supplier)
      Type of this element.
      Parameters:
      supplier - supplier of type info
      Returns:
      updated builder instance
      See Also:
    • annotations

      public Set<Annotation> annotations()
      All annotations on this element, and inherited from supertype/interface and annotations.
      Returns:
      the annotations
    • type

      public Optional<TypeInfo> type()
      Type of this element.
      Returns:
      the type
    • toString

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

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

      protected void validatePrototype()
      Validates required properties.