public final class Jsonb extends Object
Represents a jsonb
value. When using JsonBinding
, null
values from the database are turned
as a null
, not a Json
instance with a null
value.
The toString()
method returns only the value without any additions, so can be used safely in place of
getValue()
.
To create an instance of a non-null
value, use of(String)
. When you have a nullable value, use
ofNullable(String)
which returns null
in case the input is null
.
Modifier and Type | Method and Description |
---|---|
static Jsonb |
copy(Jsonb in) |
boolean |
equals(Object o) |
String |
getValue()
Retrieve the non-
null JSON value |
int |
hashCode() |
static Jsonb |
of(String value)
Create an instance containing the non-
null string. |
static Jsonb |
ofNullable(String value)
Create an instance containing string if it's not
null . |
String |
toString() |
public static Jsonb of(String value)
null
string. No checks are done to validate if the string is valid
JSON.value
- non-null
stringofNullable(String)
public static Jsonb ofNullable(String value)
null
. When the value
is null
,
null
is returned. No checks are done to validate if the string is valid JSON.value
- nullable stringnull
of(String)
public String getValue()
null
JSON valuenull
Copyright © 2019. All rights reserved.