Class StructuredData

  • All Implemented Interfaces:
    com.yahoo.data.access.Inspectable, JsonProducer, XmlProducer

    public class StructuredData
    extends java.lang.Object
    implements com.yahoo.data.access.Inspectable, JsonProducer, XmlProducer
    A wrapper for structured data representing feature values.
    • Constructor Summary

      Constructors 
      Constructor Description
      StructuredData​(com.yahoo.data.access.Inspector value)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      com.yahoo.data.access.Inspector inspect()  
      java.lang.String toJson()
      Convenience method equivalent to: writeJson(new StringBuilder()).toString()
      java.lang.String toString()  
      java.lang.StringBuilder writeJson​(java.lang.StringBuilder target)
      Append the JSON representation of this object's data to a StringBuilder.
      java.lang.StringBuilder writeXML​(java.lang.StringBuilder target)
      Append the XML representation of this object's data to a StringBuilder.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • StructuredData

        public StructuredData​(com.yahoo.data.access.Inspector value)
    • Method Detail

      • inspect

        public com.yahoo.data.access.Inspector inspect()
        Specified by:
        inspect in interface com.yahoo.data.access.Inspectable
      • toString

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

        public java.lang.StringBuilder writeXML​(java.lang.StringBuilder target)
        Description copied from interface: XmlProducer
        Append the XML representation of this object's data to a StringBuilder.
        Specified by:
        writeXML in interface XmlProducer
        Parameters:
        target - the StringBuilder to append to.
        Returns:
        the target passed in is also returned (to allow chaining).
      • toJson

        public java.lang.String toJson()
        Description copied from interface: JsonProducer
        Convenience method equivalent to: writeJson(new StringBuilder()).toString()
        Specified by:
        toJson in interface JsonProducer
        Returns:
        a String containing JSON representation of this object's data.
      • writeJson

        public java.lang.StringBuilder writeJson​(java.lang.StringBuilder target)
        Description copied from interface: JsonProducer
        Append the JSON representation of this object's data to a StringBuilder. Note that when passing compact=false the generated string will be human-readable and containing embedded newlines; also the exact indentation etc may change, so use compact=true for a canonical format.
        Specified by:
        writeJson in interface JsonProducer
        Parameters:
        target - the StringBuilder to append to.
        Returns:
        the target passed in is also returned (to allow chaining).