Class ImmutableDatatypeTypes.Builder

java.lang.Object
org.immutables.value.processor.ImmutableDatatypeTypes.Builder
Enclosing class:
ImmutableDatatypeTypes

@NotThreadSafe public static final class ImmutableDatatypeTypes.Builder extends Object
Builds instances of type ImmutableDatatypeTypes. Initialize attributes and then invoke the build() method to create an immutable instance.

Builder is not thread-safe and generally should not be stored in a field or collection, but instead used immediately to create instances.

  • Field Details

  • Constructor Details

    • Builder

      private Builder()
  • Method Details

    • from

      Fill a builder with attribute values from the provided DatatypeTypes instance. Regular attribute values will be replaced with those from the given instance. Absent optional values will not replace present values. Collection elements and entries will be added, not replaced.
      Parameters:
      instance - The instance from which to copy values
      Returns:
      this builder for use in a chained invocation
    • definedBy

      public final ImmutableDatatypeTypes.Builder definedBy(Proto.AbstractDeclaring definedBy)
      Initializes the value for the definedBy attribute.
      Parameters:
      definedBy - The value for definedBy
      Returns:
      this builder for use in a chained invocation
    • packageGenerated

      public final ImmutableDatatypeTypes.Builder packageGenerated(String packageGenerated)
      Initializes the value for the packageGenerated attribute.
      Parameters:
      packageGenerated - The value for packageGenerated
      Returns:
      this builder for use in a chained invocation
    • addTypes

      public final ImmutableDatatypeTypes.Builder addTypes(ValueType element)
      Adds one element to types list.
      Parameters:
      element - A types element
      Returns:
      this builder for use in a chained invocation
    • addTypes

      public final ImmutableDatatypeTypes.Builder addTypes(ValueType... elements)
      Adds elements to types list.
      Parameters:
      elements - An array of types elements
      Returns:
      this builder for use in a chained invocation
    • types

      public final ImmutableDatatypeTypes.Builder types(Iterable<? extends ValueType> elements)
      Sets or replaces all elements for types list.
      Parameters:
      elements - An iterable of types elements
      Returns:
      this builder for use in a chained invocation
    • addAllTypes

      public final ImmutableDatatypeTypes.Builder addAllTypes(Iterable<? extends ValueType> elements)
      Adds elements to types list.
      Parameters:
      elements - An iterable of types elements
      Returns:
      this builder for use in a chained invocation
    • build

      public ImmutableDatatypeTypes build()
      Returns:
      An immutable instance of DatatypeTypes
      Throws:
      IllegalStateException - if any required attributes are missing
    • formatRequiredAttributesMessage

      private String formatRequiredAttributesMessage()