public abstract class Message<T>
extends java.lang.Object
Contains methods for:
Modifier and Type | Field and Description |
---|---|
protected com.google.protobuf.GeneratedMessageV3.Builder |
builder |
protected WrapperFactory |
wrapperFactory |
Constructor and Description |
---|
Message(com.google.protobuf.GeneratedMessageV3.Builder builder)
Base constructor for creating a new message.
|
Message(javax.json.JsonReader jsonReader,
com.google.protobuf.GeneratedMessageV3.Builder builder)
Base constructor used when reading from JSON.
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(java.lang.Object o)
Method to check if another object equals this object.
|
T |
getApiObject()
Method to return the underlying API object in GRPC format.
|
java.lang.String |
getMessageName() |
int |
hashCode() |
protected void |
populateRepeatedFields()
Method to be overrided by inherited messages that contains repeatable or mapped fields.
|
javax.json.JsonObjectBuilder |
toJson()
Method to convert the Message into JSON Representation
|
java.lang.String |
toJsonAsString(boolean prettyPrint)
Method to convert Message into a json string.
|
java.lang.String |
toString()
Returns a string representation i JSON format of all data in this message.
|
ValidationResult |
validate()
Method to validate the data in the message against proto specification and
returns a ValidationReport containing all validation errors found.
|
protected WrapperFactory wrapperFactory
protected com.google.protobuf.GeneratedMessageV3.Builder builder
public Message(javax.json.JsonReader jsonReader, com.google.protobuf.GeneratedMessageV3.Builder builder) throws javax.json.JsonException
jsonReader
- the json object to parse and set all related fields.builder
- the API Object builder set by inheriting message object.javax.json.JsonException
- if problems occurred parsing the JSON data.public Message(com.google.protobuf.GeneratedMessageV3.Builder builder)
builder
- the API Object builder set by inheriting message object.public javax.json.JsonObjectBuilder toJson() throws javax.json.JsonException
javax.json.JsonException
- if problems occurred converting to json.public java.lang.String toJsonAsString(boolean prettyPrint)
prettyPrint
- if json data should be pretty printed with newlines and indentation.public T getApiObject()
protected void populateRepeatedFields()
public java.lang.String getMessageName()
public java.lang.String toString()
toString
in class java.lang.Object
public boolean equals(java.lang.Object o)
Compares the underlying API object data so can be relative resource intensive.
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public ValidationResult validate()