Class ImmutableColumnMeta.Builder

java.lang.Object
org.nuiton.db.meta.ImmutableColumnMeta.Builder
Enclosing class:
ImmutableColumnMeta

@Generated(from="ColumnMeta", generator="Immutables") public static final class ImmutableColumnMeta.Builder extends Object
Builds instances of type ImmutableColumnMeta. 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.

  • Method Details

    • from

      @CanIgnoreReturnValue public final ImmutableColumnMeta.Builder from(ColumnMeta instance)
      Fill a builder with attribute values from the provided ColumnMeta 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
    • name

      @CanIgnoreReturnValue public final ImmutableColumnMeta.Builder name(String name)
      Initializes the value for the name attribute.
      Parameters:
      name - The value for name
      Returns:
      this builder for use in a chained invocation
    • type

      @CanIgnoreReturnValue public final ImmutableColumnMeta.Builder type(String type)
      Initializes the value for the type attribute.
      Parameters:
      type - The value for type
      Returns:
      this builder for use in a chained invocation
    • customType

      @CanIgnoreReturnValue public final ImmutableColumnMeta.Builder customType(CustomTypeMeta customType)
      Initializes the optional value customType to customType.
      Parameters:
      customType - The value for customType
      Returns:
      this builder for chained invocation
    • customType

      @CanIgnoreReturnValue public final ImmutableColumnMeta.Builder customType(Optional<? extends CustomTypeMeta> customType)
      Initializes the optional value customType to customType.
      Parameters:
      customType - The value for customType
      Returns:
      this builder for use in a chained invocation
    • length

      @CanIgnoreReturnValue public final ImmutableColumnMeta.Builder length(int length)
      Initializes the optional value length to length.
      Parameters:
      length - The value for length
      Returns:
      this builder for chained invocation
    • length

      @CanIgnoreReturnValue public final ImmutableColumnMeta.Builder length(Optional<Integer> length)
      Initializes the optional value length to length.
      Parameters:
      length - The value for length
      Returns:
      this builder for use in a chained invocation
    • nullable

      @CanIgnoreReturnValue public final ImmutableColumnMeta.Builder nullable(boolean nullable)
      Initializes the value for the nullable attribute.
      Parameters:
      nullable - The value for nullable
      Returns:
      this builder for use in a chained invocation
    • comment

      @CanIgnoreReturnValue public final ImmutableColumnMeta.Builder comment(String comment)
      Initializes the optional value comment to comment.
      Parameters:
      comment - The value for comment
      Returns:
      this builder for chained invocation
    • comment

      @CanIgnoreReturnValue public final ImmutableColumnMeta.Builder comment(Optional<String> comment)
      Initializes the optional value comment to comment.
      Parameters:
      comment - The value for comment
      Returns:
      this builder for use in a chained invocation
    • isPrimaryKey

      @CanIgnoreReturnValue public final ImmutableColumnMeta.Builder isPrimaryKey(boolean isPrimaryKey)
      Initializes the value for the isPrimaryKey attribute.
      Parameters:
      isPrimaryKey - The value for isPrimaryKey
      Returns:
      this builder for use in a chained invocation
    • isUnique

      @CanIgnoreReturnValue public final ImmutableColumnMeta.Builder isUnique(boolean isUnique)
      Initializes the value for the isUnique attribute.
      Parameters:
      isUnique - The value for isUnique
      Returns:
      this builder for use in a chained invocation
    • isForeignKey

      @CanIgnoreReturnValue public final ImmutableColumnMeta.Builder isForeignKey(boolean isForeignKey)
      Initializes the value for the isForeignKey attribute.
      Parameters:
      isForeignKey - The value for isForeignKey
      Returns:
      this builder for use in a chained invocation
    • addForeignKeyColumns

      @CanIgnoreReturnValue public final ImmutableColumnMeta.Builder addForeignKeyColumns(String element)
      Adds one element to foreignKeyColumns set.
      Parameters:
      element - A foreignKeyColumns element
      Returns:
      this builder for use in a chained invocation
    • addForeignKeyColumns

      @CanIgnoreReturnValue public final ImmutableColumnMeta.Builder addForeignKeyColumns(String... elements)
      Adds elements to foreignKeyColumns set.
      Parameters:
      elements - An array of foreignKeyColumns elements
      Returns:
      this builder for use in a chained invocation
    • foreignKeyColumns

      @CanIgnoreReturnValue public final ImmutableColumnMeta.Builder foreignKeyColumns(Iterable<String> elements)
      Sets or replaces all elements for foreignKeyColumns set.
      Parameters:
      elements - An iterable of foreignKeyColumns elements
      Returns:
      this builder for use in a chained invocation
    • addAllForeignKeyColumns

      @CanIgnoreReturnValue public final ImmutableColumnMeta.Builder addAllForeignKeyColumns(Iterable<String> elements)
      Adds elements to foreignKeyColumns set.
      Parameters:
      elements - An iterable of foreignKeyColumns elements
      Returns:
      this builder for use in a chained invocation
    • possibleValues

      @CanIgnoreReturnValue public final ImmutableColumnMeta.Builder possibleValues(Map<String,String> possibleValues)
      Initializes the optional value possibleValues to possibleValues.
      Parameters:
      possibleValues - The value for possibleValues
      Returns:
      this builder for chained invocation
    • possibleValues

      @CanIgnoreReturnValue public final ImmutableColumnMeta.Builder possibleValues(Optional<? extends Map<String,String>> possibleValues)
      Initializes the optional value possibleValues to possibleValues.
      Parameters:
      possibleValues - The value for possibleValues
      Returns:
      this builder for use in a chained invocation
    • build

      public ImmutableColumnMeta build()
      Builds a new ImmutableColumnMeta.
      Returns:
      An immutable instance of ColumnMeta
      Throws:
      IllegalStateException - if any required attributes are missing