Class ColumnDef
- java.lang.Object
-
- com.zendesk.maxwell.schema.columndef.ColumnDef
-
- All Implemented Interfaces:
Cloneable
- Direct Known Subclasses:
BigIntColumnDef
,BitColumnDef
,ColumnDefWithLength
,DateColumnDef
,DecimalColumnDef
,EnumeratedColumnDef
,FloatColumnDef
,GeometryColumnDef
,IntColumnDef
,JsonColumnDef
,StringColumnDef
,YearColumnDef
public abstract class ColumnDef extends Object implements Cloneable
This class is immutable, all subclasses must be immutable and implement equals and hashCode and call this class's respective methods if the subclass has any member variables. Failure to do so will lead difficult to debug errors as these class instances are interned. Subclasses may usecloneSelfAndSet(java.util.function.Consumer<T>)
to follow clone/modify/intern pattern for maintaining interface immutability.
-
-
Field Summary
Fields Modifier and Type Field Description protected static com.google.common.collect.Interner
INTERNER
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Deprecated Methods Modifier and Type Method Description Object
asJSON(Object value)
Deprecated.Object
asJSON(Object value, MaxwellOutputConfig config)
static ColumnDef
build(String name, String charset, String type, short pos, boolean signed, String[] enumValues, Long columnLength)
ColumnDef
clone()
protected <T extends ColumnDef>
TcloneSelfAndSet(Consumer<T> mutator)
boolean
equals(Object o)
protected <T extends ColumnDef>
com.google.common.collect.Interner<T>getInterner()
String
getName()
int
getPos()
String
getType()
int
hashCode()
abstract String
toSQL(Object value)
static String
unalias_type(String type, boolean longStringFlag, Long columnLength, boolean byteFlagToStringColumn)
ColumnDef
withName(String name)
ColumnDef
withPos(short i)
-
-
-
Method Detail
-
toSQL
public abstract String toSQL(Object value) throws ColumnDefCastException
- Throws:
ColumnDefCastException
-
getInterner
protected <T extends ColumnDef> com.google.common.collect.Interner<T> getInterner()
-
asJSON
@Deprecated public Object asJSON(Object value) throws ColumnDefCastException
Deprecated.- Throws:
ColumnDefCastException
-
asJSON
public Object asJSON(Object value, MaxwellOutputConfig config) throws ColumnDefCastException
- Throws:
ColumnDefCastException
-
build
public static ColumnDef build(String name, String charset, String type, short pos, boolean signed, String[] enumValues, Long columnLength)
-
unalias_type
public static String unalias_type(String type, boolean longStringFlag, Long columnLength, boolean byteFlagToStringColumn)
-
getName
public String getName()
-
getType
public String getType()
-
getPos
public int getPos()
-
withPos
public ColumnDef withPos(short i)
-
-