public class Record
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
java.lang.String |
id |
static java.lang.String |
PROP_ID |
static java.lang.String |
PROP_TYPE |
java.lang.String |
type |
Constructor and Description |
---|
Record(java.lang.String type)
Construct a record with a default ID
|
Record(java.lang.String id,
java.lang.String type)
Construct a record from an ID and type.
|
Modifier and Type | Method and Description |
---|---|
java.lang.String |
getId()
Return the ID of the record.
|
java.lang.String |
getType()
Return the type of the record.
|
Record |
parse(com.ibm.json.java.JSONObject jsonObj)
Create the record from JSON.
|
void |
setId(java.lang.String id)
Set the ID of the record.
|
void |
setType(java.lang.String type)
Set the type of the record.
|
com.ibm.json.java.JSONObject |
toJSON()
Returns the record in JSON format.
|
public static final java.lang.String PROP_ID
public static final java.lang.String PROP_TYPE
public java.lang.String id
public java.lang.String type
public Record(java.lang.String type)
type
- the type of record to be createdpublic Record(java.lang.String id, java.lang.String type)
id
- the id.type
- the type.public java.lang.String getId()
public void setId(java.lang.String id)
id
- the ID of the record.public java.lang.String getType()
public void setType(java.lang.String type)
type
- the type of the record.public com.ibm.json.java.JSONObject toJSON()
public Record parse(com.ibm.json.java.JSONObject jsonObj)
jsonObj
- The object in JSON to be parsed.<IBM Copyright © 2018 IBM Corp. All Rights Reserved.