Package com.yahoo.search.result
Class StructuredData
- java.lang.Object
-
- com.yahoo.search.result.StructuredData
-
- All Implemented Interfaces:
com.yahoo.data.access.Inspectable
,JsonProducer
,XmlProducer
public class StructuredData extends 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()
String
toJson()
Convenience method equivalent to writeJson(new StringBuilder()).toString()String
toString()
StringBuilder
writeJson(StringBuilder target)
Append the JSON representation of this object's data to a StringBuilder.StringBuilder
writeXML(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
-
Methods inherited from interface com.yahoo.data.XmlProducer
toXML
-
-
-
-
Method Detail
-
inspect
public com.yahoo.data.access.Inspector inspect()
- Specified by:
inspect
in interfacecom.yahoo.data.access.Inspectable
-
writeXML
public StringBuilder writeXML(StringBuilder target)
Description copied from interface:XmlProducer
Append the XML representation of this object's data to a StringBuilder.- Specified by:
writeXML
in interfaceXmlProducer
- Parameters:
target
- the StringBuilder to append to.- Returns:
- the target passed in is also returned (to allow chaining).
-
toJson
public String toJson()
Description copied from interface:JsonProducer
Convenience method equivalent to writeJson(new StringBuilder()).toString()- Specified by:
toJson
in interfaceJsonProducer
- Returns:
- a String containing JSON representation of this object's data
-
writeJson
public StringBuilder writeJson(StringBuilder target)
Description copied from interface:JsonProducer
Append the JSON representation of this object's data to a StringBuilder.- Specified by:
writeJson
in interfaceJsonProducer
- Parameters:
target
- the StringBuilder to append to- Returns:
- the target passed in is also returned (to allow chaining)
-
-