Class ImmutableColumnMeta
java.lang.Object
org.nuiton.db.meta.ImmutableColumnMeta
- All Implemented Interfaces:
ColumnMeta
@Generated(from="ColumnMeta",
generator="Immutables")
@ParametersAreNonnullByDefault
@Generated("org.immutables.processor.ProxyProcessor")
@Immutable
@CheckReturnValue
public final class ImmutableColumnMeta
extends Object
implements ColumnMeta
Immutable implementation of
ColumnMeta.
Use the builder to create immutable instances:
ImmutableColumnMeta.builder().
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classBuilds instances of typeImmutableColumnMeta. -
Method Summary
Modifier and TypeMethodDescriptionstatic ImmutableColumnMeta.Builderbuilder()Creates a builder forImmutableColumnMeta.static ImmutableColumnMetacopyOf(ColumnMeta instance) Creates an immutable copy of aColumnMetavalue.booleanThis instance is equal to all instances ofImmutableColumnMetathat have equal attribute values.com.google.common.collect.ImmutableSet<String> getName()booleangetType()inthashCode()Computes a hash code from attributes:name,type,customType,length,nullable,comment,isPrimaryKey,isUnique,isForeignKey,foreignKeyColumns,possibleValues.booleanbooleanbooleanisUnique()toString()Prints the immutable valueColumnMetawith attribute values.final ImmutableColumnMetawithComment(String value) Copy the current immutable object by setting a present value for the optionalcommentattribute.final ImmutableColumnMetawithComment(Optional<String> optional) Copy the current immutable object by setting an optional value for thecommentattribute.final ImmutableColumnMetawithCustomType(Optional<? extends CustomTypeMeta> optional) Copy the current immutable object by setting an optional value for thecustomTypeattribute.final ImmutableColumnMetawithCustomType(CustomTypeMeta value) Copy the current immutable object by setting a present value for the optionalcustomTypeattribute.final ImmutableColumnMetawithForeignKeyColumns(Iterable<String> elements) Copy the current immutable object with elements that replace the content offoreignKeyColumns.final ImmutableColumnMetawithForeignKeyColumns(String... elements) Copy the current immutable object with elements that replace the content offoreignKeyColumns.final ImmutableColumnMetawithIsForeignKey(boolean value) Copy the current immutable object by setting a value for theisForeignKeyattribute.final ImmutableColumnMetawithIsPrimaryKey(boolean value) Copy the current immutable object by setting a value for theisPrimaryKeyattribute.final ImmutableColumnMetawithIsUnique(boolean value) Copy the current immutable object by setting a value for theisUniqueattribute.final ImmutableColumnMetawithLength(int value) Copy the current immutable object by setting a present value for the optionallengthattribute.final ImmutableColumnMetawithLength(Optional<Integer> optional) Copy the current immutable object by setting an optional value for thelengthattribute.final ImmutableColumnMetaCopy the current immutable object by setting a value for thenameattribute.final ImmutableColumnMetawithNullable(boolean value) Copy the current immutable object by setting a value for thenullableattribute.final ImmutableColumnMetawithPossibleValues(Map<String, String> value) Copy the current immutable object by setting a present value for the optionalpossibleValuesattribute.final ImmutableColumnMetawithPossibleValues(Optional<? extends Map<String, String>> optional) Copy the current immutable object by setting an optional value for thepossibleValuesattribute.final ImmutableColumnMetaCopy the current immutable object by setting a value for thetypeattribute.
-
Method Details
-
getName
- Specified by:
getNamein interfaceColumnMeta- Returns:
- The value of the
nameattribute
-
getType
- Specified by:
getTypein interfaceColumnMeta- Returns:
- The value of the
typeattribute
-
getCustomType
- Specified by:
getCustomTypein interfaceColumnMeta- Returns:
- The value of the
customTypeattribute
-
getLength
- Specified by:
getLengthin interfaceColumnMeta- Returns:
- The value of the
lengthattribute
-
getNullable
public boolean getNullable()- Specified by:
getNullablein interfaceColumnMeta- Returns:
- The value of the
nullableattribute
-
getComment
- Specified by:
getCommentin interfaceColumnMeta- Returns:
- The value of the
commentattribute
-
isPrimaryKey
public boolean isPrimaryKey()- Specified by:
isPrimaryKeyin interfaceColumnMeta- Returns:
- The value of the
isPrimaryKeyattribute
-
isUnique
public boolean isUnique()- Specified by:
isUniquein interfaceColumnMeta- Returns:
- The value of the
isUniqueattribute
-
isForeignKey
public boolean isForeignKey()- Specified by:
isForeignKeyin interfaceColumnMeta- Returns:
- The value of the
isForeignKeyattribute
-
getForeignKeyColumns
- Specified by:
getForeignKeyColumnsin interfaceColumnMeta- Returns:
- The value of the
foreignKeyColumnsattribute
-
getPossibleValues
- Specified by:
getPossibleValuesin interfaceColumnMeta- Returns:
- The value of the
possibleValuesattribute
-
withName
Copy the current immutable object by setting a value for thenameattribute. An equals check used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for name- Returns:
- A modified copy or the
thisobject
-
withType
Copy the current immutable object by setting a value for thetypeattribute. An equals check used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for type- Returns:
- A modified copy or the
thisobject
-
withCustomType
Copy the current immutable object by setting a present value for the optionalcustomTypeattribute.- Parameters:
value- The value for customType- Returns:
- A modified copy or
thisif not changed
-
withCustomType
Copy the current immutable object by setting an optional value for thecustomTypeattribute. A shallow reference equality check is used on unboxed optional value to prevent copying of the same value by returningthis.- Parameters:
optional- An optional value for customType- Returns:
- A modified copy or
thisif not changed
-
withLength
Copy the current immutable object by setting a present value for the optionallengthattribute.- Parameters:
value- The value for length- Returns:
- A modified copy or
thisif not changed
-
withLength
Copy the current immutable object by setting an optional value for thelengthattribute. An equality check is used on inner value to prevent copying of the same value by returningthis.- Parameters:
optional- An optional value for length- Returns:
- A modified copy or
thisif not changed
-
withNullable
Copy the current immutable object by setting a value for thenullableattribute. A value equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for nullable- Returns:
- A modified copy or the
thisobject
-
withComment
Copy the current immutable object by setting a present value for the optionalcommentattribute.- Parameters:
value- The value for comment- Returns:
- A modified copy or
thisif not changed
-
withComment
Copy the current immutable object by setting an optional value for thecommentattribute. An equality check is used on inner value to prevent copying of the same value by returningthis.- Parameters:
optional- An optional value for comment- Returns:
- A modified copy or
thisif not changed
-
withIsPrimaryKey
Copy the current immutable object by setting a value for theisPrimaryKeyattribute. A value equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for isPrimaryKey- Returns:
- A modified copy or the
thisobject
-
withIsUnique
Copy the current immutable object by setting a value for theisUniqueattribute. A value equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for isUnique- Returns:
- A modified copy or the
thisobject
-
withIsForeignKey
Copy the current immutable object by setting a value for theisForeignKeyattribute. A value equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for isForeignKey- Returns:
- A modified copy or the
thisobject
-
withForeignKeyColumns
Copy the current immutable object with elements that replace the content offoreignKeyColumns.- Parameters:
elements- The elements to set- Returns:
- A modified copy of
thisobject
-
withForeignKeyColumns
Copy the current immutable object with elements that replace the content offoreignKeyColumns. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
elements- An iterable of foreignKeyColumns elements to set- Returns:
- A modified copy or
thisif not changed
-
withPossibleValues
Copy the current immutable object by setting a present value for the optionalpossibleValuesattribute.- Parameters:
value- The value for possibleValues- Returns:
- A modified copy or
thisif not changed
-
withPossibleValues
public final ImmutableColumnMeta withPossibleValues(Optional<? extends Map<String, String>> optional) Copy the current immutable object by setting an optional value for thepossibleValuesattribute. A shallow reference equality check is used on unboxed optional value to prevent copying of the same value by returningthis.- Parameters:
optional- An optional value for possibleValues- Returns:
- A modified copy or
thisif not changed
-
equals
-
hashCode
-
toString
-
copyOf
Creates an immutable copy of aColumnMetavalue. Uses accessors to get values to initialize the new immutable instance. If an instance is already immutable, it is returned as is.- Parameters:
instance- The instance to copy- Returns:
- A copied immutable ColumnMeta instance
-
builder
Creates a builder forImmutableColumnMeta.ImmutableColumnMeta.builder() .name(String) // required
name.type(String) // requiredtype.customType(Optional<org.nuiton.db.meta.CustomTypeMeta>) // optionalcustomType.length(Optional<Integer>) // optionallength.nullable(boolean) // requirednullable.comment(Optional<String>) // optionalcomment.isPrimaryKey(boolean) // requiredisPrimaryKey.isUnique(boolean) // requiredisUnique.isForeignKey(boolean) // requiredisForeignKey.addForeignKeyColumns|addAllForeignKeyColumns(String) //foreignKeyColumnselements .possibleValues(Optional<Map<String, String>>) // optionalpossibleValues.build();- Returns:
- A new ImmutableColumnMeta builder
-