Class Struct

  • All Implemented Interfaces:
    java.lang.Cloneable, java.lang.Comparable<FieldValue>

    public class Struct
    extends StructuredFieldValue
    Author:
    HÃ¥kon Humberset
    • Field Detail

      • classId

        public static final int classId
    • Constructor Detail

      • Struct

        public Struct​(DataType type)
    • Method Detail

      • setVersion

        public void setVersion​(int version)
      • getVersion

        public int getVersion()
      • getCompressionType

        public com.yahoo.compress.CompressionType getCompressionType()
      • getCompressionLevel

        public int getCompressionLevel()
      • getCompressionThreshold

        public float getCompressionThreshold()
      • getFields

        public java.util.Set<java.util.Map.Entry<Field,​FieldValue>> getFields()
      • getFieldValue

        public FieldValue getFieldValue​(Field field)
        Description copied from class: StructuredFieldValue
        Returns the value of the given field. If the field does not exist, this method returns null.
        Specified by:
        getFieldValue in class StructuredFieldValue
        Parameters:
        field - The field whose value to return.
        Returns:
        The value of the field, or null.
      • getField

        public Field getField​(java.lang.String fieldName)
        Description copied from class: StructuredFieldValue
        Returns the named field object, or null if that field does not exist.
        Specified by:
        getField in class StructuredFieldValue
        Parameters:
        fieldName - The name of the field to return.
        Returns:
        The corresponding field, or null.
      • assign

        public void assign​(java.lang.Object o)
        Description copied from class: FieldValue
        Assign this non-fieldvalue value to this field value. This is used to be able to assign ints to Integer field values and List to Array field values and such.

        Override to accept the specific types that should be legal.

        Specified by:
        assign in class FieldValue
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class com.yahoo.vespa.objects.Identifiable
      • getFieldValue

        public static <T> T getFieldValue​(FieldValue struct,
                                          DataType structType,
                                          java.lang.String fieldName,
                                          java.lang.Class<T> fieldType)
      • getFieldValue

        public static <T> T getFieldValue​(FieldValue struct,
                                          DataType structType,
                                          Field field,
                                          java.lang.Class<T> fieldType)