Record Class TableSchema.ColumnDefinition
java.lang.Object
java.lang.Record
group.worldstandard.pudel.api.database.TableSchema.ColumnDefinition
- Enclosing class:
TableSchema
public static record TableSchema.ColumnDefinition(String name, ColumnType type, Integer size, boolean nullable, String defaultValue)
extends Record
Represents the definition of a database column within a table schema.
Contains metadata about the column including its name, data type, size,
nullability constraint, and default value.
This record is used internally by the schema builder to construct database table definitions. Column definitions are immutable once created.
The column type determines how the column is represented in SQL, with optional size parameters for variable-length types like VARCHAR or NUMERIC. Nullability controls whether the column can contain NULL values. Default values are specified as strings and should be compatible with the column's data type.
-
Constructor Summary
ConstructorsConstructorDescriptionColumnDefinition(String name, ColumnType type, Integer size, boolean nullable, String defaultValue) Creates an instance of aColumnDefinitionrecord class. -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of thedefaultValuerecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.name()Returns the value of thenamerecord component.booleannullable()Returns the value of thenullablerecord component.size()Returns the value of thesizerecord component.final StringtoString()Returns a string representation of this record class.type()Returns the value of thetyperecord component.
-
Constructor Details
-
ColumnDefinition
public ColumnDefinition(String name, ColumnType type, Integer size, boolean nullable, String defaultValue) Creates an instance of aColumnDefinitionrecord class.- Parameters:
name- the value for thenamerecord componenttype- the value for thetyperecord componentsize- the value for thesizerecord componentnullable- the value for thenullablerecord componentdefaultValue- the value for thedefaultValuerecord component
-
-
Method Details
-
toString
-
hashCode
-
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with thecomparemethod from their corresponding wrapper classes. -
name
Returns the value of thenamerecord component.- Returns:
- the value of the
namerecord component
-
type
Returns the value of thetyperecord component.- Returns:
- the value of the
typerecord component
-
size
Returns the value of thesizerecord component.- Returns:
- the value of the
sizerecord component
-
nullable
public boolean nullable()Returns the value of thenullablerecord component.- Returns:
- the value of the
nullablerecord component
-
defaultValue
Returns the value of thedefaultValuerecord component.- Returns:
- the value of the
defaultValuerecord component
-