public class SelfDescribingJson extends Object
| Constructor and Description |
|---|
SelfDescribingJson(String schema)
Builds a SelfDescribingJson object
|
SelfDescribingJson(String schema,
Object data)
Builds a SelfDescribingJson object
|
SelfDescribingJson(String schema,
SelfDescribingJson data)
Builds a SelfDescribingJson object
|
SelfDescribingJson(String schema,
TrackerPayload data)
Builds a SelfDescribingJson object
|
| Modifier and Type | Method and Description |
|---|---|
long |
getByteSize() |
Map<String,Object> |
getMap() |
SelfDescribingJson |
setData(Object data)
Adds data to the SelfDescribingJson
- Accepts a POJO
|
SelfDescribingJson |
setData(SelfDescribingJson selfDescribingJson)
Allows us to add data from one SelfDescribingJson into another
without copying over the Schema.
|
SelfDescribingJson |
setData(TrackerPayload trackerPayload)
Adds data to the SelfDescribingJson
- Accepts a TrackerPayload object
|
SelfDescribingJson |
setSchema(String schema)
Sets the Schema for the SelfDescribingJson
|
String |
toString() |
public SelfDescribingJson(@NonNull
String schema)
schema - the schema stringpublic SelfDescribingJson(@NonNull
String schema,
@NonNull
TrackerPayload data)
schema - the schema stringdata - to nest into the object
as a TrackerPayloadpublic SelfDescribingJson(@NonNull
String schema,
@NonNull
SelfDescribingJson data)
schema - the schema stringdata - to nest into the object
as a SelfDescribingJson@NonNull public SelfDescribingJson setSchema(@NonNull String schema)
schema - a valid schema string@NonNull public SelfDescribingJson setData(@Nullable TrackerPayload trackerPayload)
trackerPayload - the data to be added to the SelfDescribingJson@NonNull public SelfDescribingJson setData(@Nullable Object data)
data - the data to be added to the SelfDescribingJson@NonNull public SelfDescribingJson setData(@Nullable SelfDescribingJson selfDescribingJson)
selfDescribingJson - the payload to add to the SelfDescribingJsonpublic long getByteSize()