Class 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 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 to primitive(String, int, int, boolean), where phantom == false.
        Parameters:
        fieldName - the name of the field.
        sqlTypeCode - the SQL type code for this field. Should match values found in Types
        nullable - one of DatabaseMetaData.columnNoNulls, DatabaseMetaData.columnNullable, or DatabaseMetaData.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 in Types
        nullable - one of DatabaseMetaData.columnNoNulls, DatabaseMetaData.columnNullable, or DatabaseMetaData.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 of DatabaseMetaData.columnNoNulls, DatabaseMetaData.columnNullable, or DatabaseMetaData.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 of DatabaseMetaData.columnNoNulls, DatabaseMetaData.columnNullable, or DatabaseMetaData.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()
      • isNullable

        public int isNullable()
      • isPhantom

        public boolean isPhantom()
      • equals

        public boolean equals​(java.lang.Object other)
        Overrides:
        equals in class java.lang.Object
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object