Constructor and Description |
---|
SelfDescribingJson(java.lang.String schema)
Creates a SelfDescribingJson with only a Schema
String and an empty data map.
|
SelfDescribingJson(java.lang.String schema,
java.lang.Object data)
Creates a SelfDescribingJson with a Schema and a
data object.
|
SelfDescribingJson(java.lang.String schema,
SelfDescribingJson data)
Creates a SelfDescribingJson with a Schema and a
SelfDescribingJson object.
|
SelfDescribingJson(java.lang.String schema,
TrackerPayload data)
Creates a SelfDescribingJson with a Schema and a
TrackerPayload object.
|
Modifier and Type | Method and Description |
---|---|
void |
add(java.lang.String key,
java.lang.String value)
Deprecated.
|
void |
addMap(java.util.Map<java.lang.String,?> map,
boolean base64Encoded,
java.lang.String typeEncoded,
java.lang.String typeNotEncoded)
Deprecated.
|
void |
addMap(java.util.Map<java.lang.String,java.lang.String> map)
Deprecated.
|
boolean |
equals(java.lang.Object o) |
long |
getByteSize()
Returns the byte size of a payload.
|
java.util.Map<java.lang.String,java.lang.Object> |
getMap()
Returns the Payload as a Map.
|
int |
hashCode() |
SelfDescribingJson |
setData(java.lang.Object data)
Adds data to the SelfDescribingJson
|
SelfDescribingJson |
setData(SelfDescribingJson data)
Allows us to add data from one SelfDescribingJson into another
without copying over the Schema.
|
SelfDescribingJson |
setData(TrackerPayload data)
Adds data to the SelfDescribingJson from a TrackerPayload object.
|
SelfDescribingJson |
setSchema(java.lang.String schema)
Sets the Schema for the SelfDescribingJson
|
java.lang.String |
toString()
Returns the Payload as a string.
|
public SelfDescribingJson(java.lang.String schema)
schema
- the schema stringpublic SelfDescribingJson(java.lang.String schema, TrackerPayload data)
schema
- the schema stringdata
- a TrackerPayload object to be embedded as
the datapublic SelfDescribingJson(java.lang.String schema, SelfDescribingJson data)
schema
- the schema stringdata
- a SelfDescribingJson object to be embedded as
the datapublic SelfDescribingJson(java.lang.String schema, java.lang.Object data)
schema
- the schema stringdata
- an object to attempt to embed as datapublic SelfDescribingJson setSchema(java.lang.String schema)
schema
- a valid schema stringpublic SelfDescribingJson setData(TrackerPayload data)
data
- the data to be added to the SelfDescribingJsonpublic SelfDescribingJson setData(java.lang.Object data)
data
- the data to be added to the SelfDescribingJsonpublic SelfDescribingJson setData(SelfDescribingJson data)
data
- the payload to add to the SelfDescribingJson@Deprecated public void add(java.lang.String key, java.lang.String value)
Payload
@Deprecated public void addMap(java.util.Map<java.lang.String,java.lang.String> map)
Payload
Payload.add(String, String)
for each key value pair.@Deprecated public void addMap(java.util.Map<java.lang.String,?> map, boolean base64Encoded, java.lang.String typeEncoded, java.lang.String typeNotEncoded)
Payload
addMap
in interface Payload
map
- Map to be converted to a String and stored as a valuebase64Encoded
- The option you choose to encode the datatypeEncoded
- The key that would be set if the encoding option was set to truetypeNotEncoded
- They key that would be set if the encoding option was set to falsepublic java.util.Map<java.lang.String,java.lang.Object> getMap()
public long getByteSize()
getByteSize
in interface Payload
public java.lang.String toString()
public boolean equals(java.lang.Object o)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object