Class StructField
- java.lang.Object
-
- com.snowflake.snowpark_java.types.StructField
-
public class StructField extends java.lang.ObjectRepresents the content of StructType.- Since:
- 0.9.0
-
-
Constructor Summary
Constructors Constructor Description StructField(ColumnIdentifier columnIdentifier, DataType dataType)Creates a new StructField with nullable column.StructField(ColumnIdentifier columnIdentifier, DataType dataType, boolean nullable)Creates a new StructField.StructField(java.lang.String name, DataType dataType)Creates a new StructField with nullable column.StructField(java.lang.String name, DataType dataType, boolean nullable)Creates a new StructField.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ColumnIdentifiercolumnIdentifier()Retrieves the column identifier.DataTypedataType()Retrieves the column data type.booleanequals(java.lang.Object other)Verifies if a StructField equals to this one.inthashCode()Calculates the hash code of this StructField Object.java.lang.Stringname()Retrieves the column name.booleannullable()Verifies if this column is nullable.java.lang.StringtoString()Generates a String value to represent this StructField.
-
-
-
Constructor Detail
-
StructField
public StructField(ColumnIdentifier columnIdentifier, DataType dataType, boolean nullable)
Creates a new StructField.- Parameters:
columnIdentifier- A ColumnIdentifier presenting column namedataType- The column data typenullable- Whether the column is nullable or not- Since:
- 0.9.0
-
StructField
public StructField(ColumnIdentifier columnIdentifier, DataType dataType)
Creates a new StructField with nullable column.- Parameters:
columnIdentifier- A ColumnIdentifier presenting column namedataType- The column data type- Since:
- 0.9.0
-
StructField
public StructField(java.lang.String name, DataType dataType, boolean nullable)Creates a new StructField.- Parameters:
name- The column namedataType- The column data typenullable- Whether the column is nullable or not- Since:
- 0.9.0
-
StructField
public StructField(java.lang.String name, DataType dataType)Creates a new StructField with nullable column.- Parameters:
name- The column namedataType- The column data type- Since:
- 0.9.0
-
-
Method Detail
-
name
public java.lang.String name()
Retrieves the column name.- Returns:
- A String value representing the column name
- Since:
- 0.9.0
-
columnIdentifier
public ColumnIdentifier columnIdentifier()
Retrieves the column identifier.- Returns:
- A ColumnIdentifier representing the column name
- Since:
- 0.9.0
-
dataType
public DataType dataType()
Retrieves the column data type.- Returns:
- A DataType object representing the column data type
- Since:
- 0.9.0
-
nullable
public boolean nullable()
Verifies if this column is nullable.- Returns:
- A boolean value representing whether this column is nullable
- Since:
- 0.9.0
-
toString
public java.lang.String toString()
Generates a String value to represent this StructField.- Overrides:
toStringin classjava.lang.Object- Returns:
- A String value in the format of "StructField('name', 'data type', 'nullable')"
- Since:
- 0.9.0
-
equals
public boolean equals(java.lang.Object other)
Verifies if a StructField equals to this one.- Overrides:
equalsin classjava.lang.Object- Parameters:
other- A StructField object- Returns:
- true if these two StructFields are equivalent, false for otherwise.
- Since:
- 0.9.0
-
hashCode
public int hashCode()
Calculates the hash code of this StructField Object.- Overrides:
hashCodein classjava.lang.Object- Returns:
- An int number representing the hash code value
- Since:
- 0.9.0
-
-