@ParametersAreNonnullByDefault @Generated(value="org.immutables.processor.ProxyProcessor") @Immutable @CheckReturnValue public final class ImmutableColumnMeta extends Object implements ColumnMeta
ColumnMeta.
Use the builder to create immutable instances:
ImmutableColumnMeta.builder().
| Modifier and Type | Class and Description |
|---|---|
static class |
ImmutableColumnMeta.Builder
Builds instances of type
ImmutableColumnMeta. |
| Modifier and Type | Method and Description |
|---|---|
static ImmutableColumnMeta.Builder |
builder()
Creates a builder for
ImmutableColumnMeta. |
static ImmutableColumnMeta |
copyOf(ColumnMeta instance)
Creates an immutable copy of a
ColumnMeta value. |
boolean |
equals(Object another)
This instance is equal to all instances of
ImmutableColumnMeta that have equal attribute values. |
Optional<String> |
getComment() |
Optional<CustomTypeMeta> |
getCustomType() |
com.google.common.collect.ImmutableSet<String> |
getForeignKeyColumns() |
Optional<Integer> |
getLength() |
String |
getName() |
boolean |
getNullable() |
Optional<Map<String,String>> |
getPossibleValues() |
String |
getType() |
int |
hashCode()
Computes a hash code from attributes:
name, type, customType, length, nullable, comment, isPrimaryKey, isUnique, isForeignKey, foreignKeyColumns, possibleValues. |
boolean |
isForeignKey() |
boolean |
isPrimaryKey() |
boolean |
isUnique() |
String |
toString()
Prints the immutable value
ColumnMeta with attribute values. |
ImmutableColumnMeta |
withComment(Optional<String> optional)
Copy the current immutable object by setting an optional value for the
comment attribute. |
ImmutableColumnMeta |
withComment(String value)
Copy the current immutable object by setting a present value for the optional
comment attribute. |
ImmutableColumnMeta |
withCustomType(CustomTypeMeta value)
Copy the current immutable object by setting a present value for the optional
customType attribute. |
ImmutableColumnMeta |
withCustomType(Optional<? extends CustomTypeMeta> optional)
Copy the current immutable object by setting an optional value for the
customType attribute. |
ImmutableColumnMeta |
withForeignKeyColumns(Iterable<String> elements)
Copy the current immutable object with elements that replace the content of
foreignKeyColumns. |
ImmutableColumnMeta |
withForeignKeyColumns(String... elements)
Copy the current immutable object with elements that replace the content of
foreignKeyColumns. |
ImmutableColumnMeta |
withIsForeignKey(boolean value)
Copy the current immutable object by setting a value for the
isForeignKey attribute. |
ImmutableColumnMeta |
withIsPrimaryKey(boolean value)
Copy the current immutable object by setting a value for the
isPrimaryKey attribute. |
ImmutableColumnMeta |
withIsUnique(boolean value)
Copy the current immutable object by setting a value for the
isUnique attribute. |
ImmutableColumnMeta |
withLength(int value)
Copy the current immutable object by setting a present value for the optional
length attribute. |
ImmutableColumnMeta |
withLength(Optional<Integer> optional)
Copy the current immutable object by setting an optional value for the
length attribute. |
ImmutableColumnMeta |
withName(String value)
Copy the current immutable object by setting a value for the
name attribute. |
ImmutableColumnMeta |
withNullable(boolean value)
Copy the current immutable object by setting a value for the
nullable attribute. |
ImmutableColumnMeta |
withPossibleValues(Map<String,String> value)
Copy the current immutable object by setting a present value for the optional
possibleValues attribute. |
ImmutableColumnMeta |
withPossibleValues(Optional<? extends Map<String,String>> optional)
Copy the current immutable object by setting an optional value for the
possibleValues attribute. |
ImmutableColumnMeta |
withType(String value)
Copy the current immutable object by setting a value for the
type attribute. |
public String getName()
getName in interface ColumnMetaname attributepublic String getType()
getType in interface ColumnMetatype attributepublic Optional<CustomTypeMeta> getCustomType()
getCustomType in interface ColumnMetacustomType attributepublic Optional<Integer> getLength()
getLength in interface ColumnMetalength attributepublic boolean getNullable()
getNullable in interface ColumnMetanullable attributepublic Optional<String> getComment()
getComment in interface ColumnMetacomment attributepublic boolean isPrimaryKey()
isPrimaryKey in interface ColumnMetaisPrimaryKey attributepublic boolean isUnique()
isUnique in interface ColumnMetaisUnique attributepublic boolean isForeignKey()
isForeignKey in interface ColumnMetaisForeignKey attributepublic com.google.common.collect.ImmutableSet<String> getForeignKeyColumns()
getForeignKeyColumns in interface ColumnMetaforeignKeyColumns attributepublic Optional<Map<String,String>> getPossibleValues()
getPossibleValues in interface ColumnMetapossibleValues attributepublic final ImmutableColumnMeta withName(String value)
name attribute.
An equals check used to prevent copying of the same value by returning this.value - A new value for namethis objectpublic final ImmutableColumnMeta withType(String value)
type attribute.
An equals check used to prevent copying of the same value by returning this.value - A new value for typethis objectpublic final ImmutableColumnMeta withCustomType(CustomTypeMeta value)
customType attribute.value - The value for customTypethis objectpublic final ImmutableColumnMeta withCustomType(Optional<? extends CustomTypeMeta> optional)
customType attribute.
A shallow reference equality check is used on unboxed optional value to prevent copying of the same value by returning this.optional - A value for customTypethis objectpublic final ImmutableColumnMeta withLength(int value)
length attribute.value - The value for lengththis objectpublic final ImmutableColumnMeta withLength(Optional<Integer> optional)
length attribute.
An equality check is used on inner nullable value to prevent copying of the same value by returning this.optional - A value for lengththis objectpublic final ImmutableColumnMeta withNullable(boolean value)
nullable attribute.
A value equality check is used to prevent copying of the same value by returning this.value - A new value for nullablethis objectpublic final ImmutableColumnMeta withComment(String value)
comment attribute.value - The value for commentthis objectpublic final ImmutableColumnMeta withComment(Optional<String> optional)
comment attribute.
An equality check is used on inner nullable value to prevent copying of the same value by returning this.optional - A value for commentthis objectpublic final ImmutableColumnMeta withIsPrimaryKey(boolean value)
isPrimaryKey attribute.
A value equality check is used to prevent copying of the same value by returning this.value - A new value for isPrimaryKeythis objectpublic final ImmutableColumnMeta withIsUnique(boolean value)
isUnique attribute.
A value equality check is used to prevent copying of the same value by returning this.value - A new value for isUniquethis objectpublic final ImmutableColumnMeta withIsForeignKey(boolean value)
isForeignKey attribute.
A value equality check is used to prevent copying of the same value by returning this.value - A new value for isForeignKeythis objectpublic final ImmutableColumnMeta withForeignKeyColumns(String... elements)
foreignKeyColumns.elements - The elements to setthis objectpublic final ImmutableColumnMeta withForeignKeyColumns(Iterable<String> elements)
foreignKeyColumns.
A shallow reference equality check is used to prevent copying of the same value by returning this.elements - An iterable of foreignKeyColumns elements to setthis objectpublic final ImmutableColumnMeta withPossibleValues(Map<String,String> value)
possibleValues attribute.value - The value for possibleValuesthis objectpublic final ImmutableColumnMeta withPossibleValues(Optional<? extends Map<String,String>> optional)
possibleValues attribute.
A shallow reference equality check is used on unboxed optional value to prevent copying of the same value by returning this.optional - A value for possibleValuesthis objectpublic boolean equals(@Nullable Object another)
ImmutableColumnMeta that have equal attribute values.public int hashCode()
name, type, customType, length, nullable, comment, isPrimaryKey, isUnique, isForeignKey, foreignKeyColumns, possibleValues.public String toString()
ColumnMeta with attribute values.public static ImmutableColumnMeta copyOf(ColumnMeta instance)
ColumnMeta value.
Uses accessors to get values to initialize the new immutable instance.
If an instance is already immutable, it is returned as is.instance - The instance to copypublic static ImmutableColumnMeta.Builder builder()
ImmutableColumnMeta.
ImmutableColumnMeta.builder()
.name(String) // required name
.type(String) // required type
.customType(org.nuiton.db.meta.CustomTypeMeta) // optional customType
.length(Integer) // optional length
.nullable(boolean) // required nullable
.comment(String) // optional comment
.isPrimaryKey(boolean) // required isPrimaryKey
.isUnique(boolean) // required isUnique
.isForeignKey(boolean) // required isForeignKey
.addForeignKeyColumns|addAllForeignKeyColumns(String) // foreignKeyColumns elements
.possibleValues(Map<String, String>) // optional possibleValues
.build();
Copyright © 2019 Nuiton. All rights reserved.