Package com.hazelcast.core
Class HazelcastJsonValue
- java.lang.Object
-
- com.hazelcast.core.HazelcastJsonValue
-
- All Implemented Interfaces:
java.lang.Comparable<HazelcastJsonValue>
public final class HazelcastJsonValue extends java.lang.Object implements java.lang.Comparable<HazelcastJsonValue>
HazelcastJsonValue is a wrapper for JSON formatted strings. It is preferred to store HazelcastJsonValue instead of Strings for JSON-formatted strings. It allows you to run predicates/aggregations and use indexes on the attributes of the underlying JSON strings.HazelcastJsonValue can be queried for fields in Hazelcast's queries. See
Predicates
.When querying, numbers in JSON strings are treated as either
Long
orDouble
. Strings, booleans and nulls are treated as their Java counterparts.HazelcastJsonValue stores the given string as is. It is not validated. Ill-formatted JSON strings may cause false positive or false negative results in queries.
null
string is not allowed.
-
-
Constructor Summary
Constructors Constructor Description HazelcastJsonValue(java.lang.String value)
Creates a HazelcastJsonValue from the given string.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
compareTo(HazelcastJsonValue o)
boolean
equals(java.lang.Object o)
java.lang.String
getValue()
int
hashCode()
java.lang.String
toString()
Returns unaltered string that was used to create this object.
-
-
-
Method Detail
-
getValue
public java.lang.String getValue()
-
toString
@Nonnull public java.lang.String toString()
Returns unaltered string that was used to create this object.- Overrides:
toString
in classjava.lang.Object
- Returns:
- original string
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equals
in classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
compareTo
public int compareTo(@Nonnull HazelcastJsonValue o)
- Specified by:
compareTo
in interfacejava.lang.Comparable<HazelcastJsonValue>
-
-