Class ImmutableTableMeta.Builder

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

@Generated(from="TableMeta", generator="Immutables") public static final class ImmutableTableMeta.Builder extends Object
Builds instances of type ImmutableTableMeta. 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 ImmutableTableMeta.Builder from(TableMeta instance)
      Fill a builder with attribute values from the provided TableMeta 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 ImmutableTableMeta.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
    • isView

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

      @CanIgnoreReturnValue public final ImmutableTableMeta.Builder addColumns(ColumnMeta element)
      Adds one element to columns list.
      Parameters:
      element - A columns element
      Returns:
      this builder for use in a chained invocation
    • addColumns

      @CanIgnoreReturnValue public final ImmutableTableMeta.Builder addColumns(ColumnMeta... elements)
      Adds elements to columns list.
      Parameters:
      elements - An array of columns elements
      Returns:
      this builder for use in a chained invocation
    • columns

      @CanIgnoreReturnValue public final ImmutableTableMeta.Builder columns(Iterable<? extends ColumnMeta> elements)
      Sets or replaces all elements for columns list.
      Parameters:
      elements - An iterable of columns elements
      Returns:
      this builder for use in a chained invocation
    • addAllColumns

      @CanIgnoreReturnValue public final ImmutableTableMeta.Builder addAllColumns(Iterable<? extends ColumnMeta> elements)
      Adds elements to columns list.
      Parameters:
      elements - An iterable of columns elements
      Returns:
      this builder for use in a chained invocation
    • count

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

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

      @CanIgnoreReturnValue public final ImmutableTableMeta.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 ImmutableTableMeta.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
    • build

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