Class SearchFieldValue

  • All Implemented Interfaces:
    java.io.Externalizable, java.io.Serializable, java.lang.Cloneable

    public class SearchFieldValue
    extends java.lang.Object
    implements java.lang.Cloneable, java.io.Externalizable
    A field value for a SearchDocument.
    See Also:
    Serialized Form
    • Constructor Detail

      • SearchFieldValue

        public SearchFieldValue()
      • SearchFieldValue

        public SearchFieldValue​(java.lang.String value)
        Construct a new SearchFieldValue with a String value.
        Throws:
        java.lang.IllegalArgumentException - if value is null.
      • SearchFieldValue

        public SearchFieldValue​(java.lang.Number value)
        Construct a new SearchFieldValue with a numeric value.
        Throws:
        java.lang.IllegalArgumentException - if value is null.
      • SearchFieldValue

        public SearchFieldValue​(java.util.Date value)
        Construct a new SearchFieldValue with a Date value.
        Throws:
        java.lang.IllegalArgumentException - if value is null.
      • SearchFieldValue

        public SearchFieldValue​(java.lang.Boolean value)
        Construct a new SearchFieldValue with a Boolean value.
        Throws:
        java.lang.IllegalArgumentException - if value is null.
      • SearchFieldValue

        public SearchFieldValue​(Point value)
        Construct a new SearchFieldValue with a Point value.
        Throws:
        java.lang.IllegalArgumentException - if value is null.
      • SearchFieldValue

        public SearchFieldValue​(Shape value)
        Construct a new SearchFieldValue with a Shape value.
        Throws:
        java.lang.IllegalArgumentException - if value is null.
    • Method Detail

      • getFeatures

        public RelevancyFeatureVector getFeatures()
        Get the feature vector for this field (if available).
      • setFeatures

        public void setFeatures​(RelevancyFeatureVector value)
        Set the feature vector for this field.
      • getValue

        public java.lang.Object getValue()
        Get the field value.
      • stringValue

        public java.lang.String stringValue()
        Gets the value as a string.
      • intValue

        public int intValue()
        Gets the value as an int.
        Throws:
        java.lang.IllegalArgumentException - if this value cannot be represented as an int.
      • longValue

        public long longValue()
        Gets the value as a long.
        Throws:
        java.lang.IllegalArgumentException - if this value cannot be represented as a long.
      • doubleValue

        public double doubleValue()
        Gets the value as a double.
        Throws:
        java.lang.IllegalArgumentException - if this value cannot be represented as a double.
      • floatValue

        public float floatValue()
        Gets the value as a float.
        Throws:
        java.lang.IllegalArgumentException - if this value cannot be represented as a float.
      • dateValue

        public java.util.Date dateValue()
        Gets the value as a Date.
        Throws:
        java.lang.IllegalArgumentException - if this value cannot be represented as a Date.
      • booleanValue

        public boolean booleanValue()
        Gets the value as a boolean.
        Throws:
        java.lang.IllegalArgumentException - if this value cannot be represented as a boolean.
      • pointValue

        public Point pointValue()
        Gets the value as a Point.
        Throws:
        java.lang.IllegalArgumentException - if this value cannot be represented as a Point.
      • shapeValue

        public Shape shapeValue()
        Gets the value as a Shape.
        Throws:
        java.lang.IllegalArgumentException - if this value cannot be represented as a Shape.
      • decimalValue

        public java.math.BigDecimal decimalValue()
        Gets the value as a BigDecimal.
        Throws:
        java.lang.IllegalArgumentException - if this value cannot be represented as a BigDecimal.
      • setValue

        public void setValue​(java.lang.String value)
        Set a String value.
        Throws:
        java.lang.IllegalArgumentException - if value is null.
      • setValue

        public void setValue​(java.lang.Number value)
        Set a numeric value.
        Throws:
        java.lang.IllegalArgumentException - if value is null.
      • setValue

        public void setValue​(java.util.Date value)
        Set a Date value.
        Throws:
        java.lang.IllegalArgumentException - if value is null.
      • setValue

        public void setValue​(java.lang.Boolean value)
        Set a Boolean value.
        Throws:
        java.lang.IllegalArgumentException - if value is null.
      • setValue

        public void setValue​(Point value)
        Set a Point value.
        Throws:
        java.lang.IllegalArgumentException - if value is null.
      • setValue

        public void setValue​(Shape value)
        Set a Shape value.
        Throws:
        java.lang.IllegalArgumentException - if value is null.
      • toString

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

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

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

        public boolean valueEquals​(java.lang.Object other)
        Returns true if other equals this SearchFieldValue's value.
      • clone

        public SearchFieldValue clone()
        Overrides:
        clone in class java.lang.Object
      • valueOf

        public static SearchFieldValue valueOf​(java.lang.Object value)
        Get a SearchFieldValue for value.

        NOTE: returns null if value is null.

        Throws:
        java.lang.IllegalArgumentException - if value is not a legal value.
      • readExternal

        public void readExternal​(java.io.ObjectInput in)
                          throws java.io.IOException
        Specified by:
        readExternal in interface java.io.Externalizable
        Throws:
        java.io.IOException
      • readExternal

        public SearchFieldValue readExternal​(java.io.DataInput in)
                                      throws java.io.IOException
        Throws:
        java.io.IOException
      • writeExternal

        public void writeExternal​(java.io.ObjectOutput out)
                           throws java.io.IOException
        Specified by:
        writeExternal in interface java.io.Externalizable
        Throws:
        java.io.IOException
      • writeExternal

        public void writeExternal​(java.io.DataOutput out)
                           throws java.io.IOException
        Throws:
        java.io.IOException