Class FieldType

    • Constructor Detail

      • FieldType

        public FieldType()
    • Method Detail

      • getValueClass

        public abstract java.lang.Class getValueClass()
        Returns the class of instance values of this field type
      • toString

        public abstract java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • toInstanceDescription

        public abstract java.lang.String toInstanceDescription()
        Returns a string describing possible instances of this type, suitable for user error messages
      • convertFrom

        public abstract java.lang.Object convertFrom​(java.lang.Object o,
                                                     QueryProfileRegistry registry)
        Converts the given type to an instance of this type, if possible. Returns null if not possible.
      • convertFrom

        public abstract java.lang.Object convertFrom​(java.lang.Object o,
                                                     CompiledQueryProfileRegistry registry)
        Converts the given type to an instance of this type, if possible. Returns null if not possible.
      • asTensorType

        public com.yahoo.tensor.TensorType asTensorType()
        Returns this type as a tensor type: The true tensor type is this is a tensor field an an empty type - interpreted as a double in numerical contexts - otherwise
      • fromString

        public static FieldType fromString​(java.lang.String typeString,
                                           QueryProfileTypeRegistry registry)
        Returns the field type for a given string name.
        Parameters:
        typeString - a type string - a primitive name, "query-profile" or "query-profile:profile-name"
        registry - the registry in which query profile references are resolved when the last form above is used, or null in which case that form cannot be used
        Throws:
        java.lang.IllegalArgumentException - if the string does not resolve to a type
      • isLegalFieldValue

        public static boolean isLegalFieldValue​(java.lang.Object value)
        Returns true if the given object is a legal field value of some field value type