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 Summary
Modifier and TypeMethodDescriptionaddAllForeignKeyColumns(Iterable<String> elements) Adds elements toforeignKeyColumnsset.addForeignKeyColumns(String element) Adds one element toforeignKeyColumnsset.addForeignKeyColumns(String... elements) Adds elements toforeignKeyColumnsset.build()Builds a newImmutableColumnMeta.Initializes the optional valuecommentto comment.Initializes the optional valuecommentto comment.customType(Optional<? extends CustomTypeMeta> customType) Initializes the optional valuecustomTypeto customType.customType(CustomTypeMeta customType) Initializes the optional valuecustomTypeto customType.foreignKeyColumns(Iterable<String> elements) Sets or replaces all elements forforeignKeyColumnsset.from(ColumnMeta instance) Fill a builder with attribute values from the providedColumnMetainstance.isForeignKey(boolean isForeignKey) Initializes the value for theisForeignKeyattribute.isPrimaryKey(boolean isPrimaryKey) Initializes the value for theisPrimaryKeyattribute.isUnique(boolean isUnique) Initializes the value for theisUniqueattribute.length(int length) Initializes the optional valuelengthto length.Initializes the optional valuelengthto length.Initializes the value for thenameattribute.nullable(boolean nullable) Initializes the value for thenullableattribute.possibleValues(Map<String, String> possibleValues) Initializes the optional valuepossibleValuesto possibleValues.possibleValues(Optional<? extends Map<String, String>> possibleValues) Initializes the optional valuepossibleValuesto possibleValues.Initializes the value for thetypeattribute.
-
Method Details
-
from
Fill a builder with attribute values from the providedColumnMetainstance. 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:
thisbuilder for use in a chained invocation
-
name
Initializes the value for thenameattribute.- Parameters:
name- The value for name- Returns:
thisbuilder for use in a chained invocation
-
type
Initializes the value for thetypeattribute.- Parameters:
type- The value for type- Returns:
thisbuilder for use in a chained invocation
-
customType
@CanIgnoreReturnValue public final ImmutableColumnMeta.Builder customType(CustomTypeMeta customType) Initializes the optional valuecustomTypeto customType.- Parameters:
customType- The value for customType- Returns:
thisbuilder for chained invocation
-
customType
@CanIgnoreReturnValue public final ImmutableColumnMeta.Builder customType(Optional<? extends CustomTypeMeta> customType) Initializes the optional valuecustomTypeto customType.- Parameters:
customType- The value for customType- Returns:
thisbuilder for use in a chained invocation
-
length
Initializes the optional valuelengthto length.- Parameters:
length- The value for length- Returns:
thisbuilder for chained invocation
-
length
Initializes the optional valuelengthto length.- Parameters:
length- The value for length- Returns:
thisbuilder for use in a chained invocation
-
nullable
Initializes the value for thenullableattribute.- Parameters:
nullable- The value for nullable- Returns:
thisbuilder for use in a chained invocation
-
comment
Initializes the optional valuecommentto comment.- Parameters:
comment- The value for comment- Returns:
thisbuilder for chained invocation
-
comment
Initializes the optional valuecommentto comment.- Parameters:
comment- The value for comment- Returns:
thisbuilder for use in a chained invocation
-
isPrimaryKey
Initializes the value for theisPrimaryKeyattribute.- Parameters:
isPrimaryKey- The value for isPrimaryKey- Returns:
thisbuilder for use in a chained invocation
-
isUnique
Initializes the value for theisUniqueattribute.- Parameters:
isUnique- The value for isUnique- Returns:
thisbuilder for use in a chained invocation
-
isForeignKey
Initializes the value for theisForeignKeyattribute.- Parameters:
isForeignKey- The value for isForeignKey- Returns:
thisbuilder for use in a chained invocation
-
addForeignKeyColumns
Adds one element toforeignKeyColumnsset.- Parameters:
element- A foreignKeyColumns element- Returns:
thisbuilder for use in a chained invocation
-
addForeignKeyColumns
@CanIgnoreReturnValue public final ImmutableColumnMeta.Builder addForeignKeyColumns(String... elements) Adds elements toforeignKeyColumnsset.- Parameters:
elements- An array of foreignKeyColumns elements- Returns:
thisbuilder for use in a chained invocation
-
foreignKeyColumns
@CanIgnoreReturnValue public final ImmutableColumnMeta.Builder foreignKeyColumns(Iterable<String> elements) Sets or replaces all elements forforeignKeyColumnsset.- Parameters:
elements- An iterable of foreignKeyColumns elements- Returns:
thisbuilder for use in a chained invocation
-
addAllForeignKeyColumns
@CanIgnoreReturnValue public final ImmutableColumnMeta.Builder addAllForeignKeyColumns(Iterable<String> elements) Adds elements toforeignKeyColumnsset.- Parameters:
elements- An iterable of foreignKeyColumns elements- Returns:
thisbuilder for use in a chained invocation
-
possibleValues
@CanIgnoreReturnValue public final ImmutableColumnMeta.Builder possibleValues(Map<String, String> possibleValues) Initializes the optional valuepossibleValuesto possibleValues.- Parameters:
possibleValues- The value for possibleValues- Returns:
thisbuilder for chained invocation
-
possibleValues
@CanIgnoreReturnValue public final ImmutableColumnMeta.Builder possibleValues(Optional<? extends Map<String, String>> possibleValues) Initializes the optional valuepossibleValuesto possibleValues.- Parameters:
possibleValues- The value for possibleValues- Returns:
thisbuilder for use in a chained invocation
-
build
Builds a newImmutableColumnMeta.- Returns:
- An immutable instance of ColumnMeta
- Throws:
IllegalStateException- if any required attributes are missing
-