Class FieldDescription
- java.lang.Object
-
- com.apple.foundationdb.relational.api.FieldDescription
-
@API(EXPERIMENTAL) public final class FieldDescription extends java.lang.Object
A description of an individual field. Note that this representation is indicative of JDBC-API level information. That is, it is used to hold information that is necessary to represent a given column field in a JDBC MetaData API.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static FieldDescription
array(java.lang.String fieldName, int nullable, ArrayMetaData definition)
Create an array field.boolean
equals(java.lang.Object other)
ArrayMetaData
getArrayMetaData()
StructMetaData
getFieldMetaData()
java.lang.String
getName()
int
getSqlTypeCode()
int
hashCode()
boolean
isArray()
int
isNullable()
boolean
isPhantom()
boolean
isStruct()
static FieldDescription
primitive(java.lang.String fieldName, int sqlTypeCode, int nullable)
Create a primitive field.static FieldDescription
primitive(java.lang.String fieldName, int sqlTypeCode, int nullable, boolean phantom)
Create a primitive field.static FieldDescription
struct(java.lang.String fieldName, int nullable, StructMetaData definition)
Create a struct field.
-
-
-
Method Detail
-
primitive
public static FieldDescription primitive(@Nonnull java.lang.String fieldName, int sqlTypeCode, int nullable)
Create a primitive field. This is a convenience factory method for a more complicated constructor. Equivalent toprimitive(String, int, int, boolean)
, wherephantom == false
.- Parameters:
fieldName
- the name of the field.sqlTypeCode
- the SQL type code for this field. Should match values found inTypes
nullable
- one ofDatabaseMetaData.columnNoNulls
,DatabaseMetaData.columnNullable
, orDatabaseMetaData.columnNullableUnknown
.- Returns:
- a FieldDescription for the field.
-
primitive
public static FieldDescription primitive(@Nonnull java.lang.String fieldName, int sqlTypeCode, int nullable, boolean phantom)
Create a primitive field. This is a convenience factory method for a more complicated constructor.- Parameters:
fieldName
- the name of the field.sqlTypeCode
- the SQL type code for this field. Should match values found inTypes
nullable
- one ofDatabaseMetaData.columnNoNulls
,DatabaseMetaData.columnNullable
, orDatabaseMetaData.columnNullableUnknown
.phantom
- if true, this column should be treated as "phantom" in the API. That is, its entries are present in the returned row, but are not represented as part of the "return value". In other words, the values take up space in the physical arrays, but are not considered part of the actual return of the query, requiring the implementation to adjust for the field's position.- Returns:
- a FieldDescription for the field.
-
struct
public static FieldDescription struct(@Nonnull java.lang.String fieldName, int nullable, StructMetaData definition)
Create a struct field. This is a convenience factory method for a more complicated constructor.- Parameters:
fieldName
- the name of the field.nullable
- one ofDatabaseMetaData.columnNoNulls
,DatabaseMetaData.columnNullable
, orDatabaseMetaData.columnNullableUnknown
.definition
- the definition of the struct value itself.- Returns:
- a FieldDescription for the field.
-
array
public static FieldDescription array(@Nonnull java.lang.String fieldName, int nullable, ArrayMetaData definition)
Create an array field. This is a convenience factory method for a more complicated constructor.- Parameters:
fieldName
- the name of the field.nullable
- one ofDatabaseMetaData.columnNoNulls
,DatabaseMetaData.columnNullable
, orDatabaseMetaData.columnNullableUnknown
.definition
- the metadata description of the contents of the array.- Returns:
- a FieldDescription for the field.
-
getName
public java.lang.String getName()
-
getSqlTypeCode
public int getSqlTypeCode()
-
isStruct
public boolean isStruct()
-
isArray
public boolean isArray()
-
getFieldMetaData
public StructMetaData getFieldMetaData()
-
getArrayMetaData
public ArrayMetaData getArrayMetaData()
-
isNullable
public int isNullable()
-
isPhantom
public boolean isPhantom()
-
equals
public boolean equals(java.lang.Object other)
- Overrides:
equals
in classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
-