Record Class StructField

java.lang.Object
java.lang.Record
smile.data.type.StructField
All Implemented Interfaces:
Serializable

public record StructField(String name, DataType dtype, Measure measure) extends Record implements Serializable
A field in a Struct data type.
See Also:
  • Constructor Details

    • StructField

      public StructField(String name, DataType dtype, Measure measure)
      Constructor.
      Parameters:
      name - the field name.
      dtype - the field data type.
      measure - the level of measurement.
    • StructField

      public StructField(String name, DataType dtype)
      Constructor.
      Parameters:
      name - the field name.
      dtype - the field data type.
  • Method Details

    • toString

      public String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • toString

      public String toString(Object o)
      Returns the string representation of the field object.
      Parameters:
      o - the object.
      Returns:
      the string representation.
    • valueOf

      public Object valueOf(String s)
      Returns the object value of string.
      Parameters:
      s - the string.
      Returns:
      the object value.
    • withName

      public StructField withName(String name)
      Returns the StructField with the new name.
      Parameters:
      name - the new name.
      Returns:
      the StructField with the new name.
    • isNumeric

      public boolean isNumeric()
      Returns true if the field is of integer or floating but not nominal scale.
      Returns:
      true if the field is of integer or floating but not nominal scale.
    • equals

      public boolean equals(Object o)
      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. All components in this record class are compared with Objects::equals(Object,Object).
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • of

      public static StructField of(PropertyDescriptor prop)
      Returns the struct field of a class property.
      Parameters:
      prop - the property descriptor.
      Returns:
      the struct field.
    • of

      public static StructField of(RecordComponent comp)
      Returns the struct field of a record component.
      Parameters:
      comp - the record component.
      Returns:
      the struct field.
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • name

      public String name()
      Returns the value of the name record component.
      Returns:
      the value of the name record component
    • dtype

      public DataType dtype()
      Returns the value of the dtype record component.
      Returns:
      the value of the dtype record component
    • measure

      public Measure measure()
      Returns the value of the measure record component.
      Returns:
      the value of the measure record component