Class JsonObjectAccessorImpl
java.lang.Object
org.hibernate.search.backend.elasticsearch.gson.impl.JsonObjectAccessorImpl
- All Implemented Interfaces:
JsonAccessor<com.google.gson.JsonObject>,JsonObjectAccessor
A
JsonAccessor that ensures the accessed object is a JsonObject.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidprotected voidappendStaticRelativePath(StringBuilder path, boolean first) Optional<com.google.gson.JsonObject>get(com.google.gson.JsonObject root) Get the current value of the element this accessor points to for the givenroot.protected JsonElementType<com.google.gson.JsonObject>com.google.gson.JsonObjectgetOrCreate(com.google.gson.JsonObject root) com.google.gson.JsonObjectgetOrCreate(com.google.gson.JsonObject root, Supplier<? extends com.google.gson.JsonObject> newValueSupplier) Get the current value of the element this accessor points to for the givenroot, creating it and setting it if it hasn't been set yet.protected JsonAccessor<com.google.gson.JsonElement>voidset(com.google.gson.JsonObject root, com.google.gson.JsonObject newValue) Set the given value on the element this accessor points to for the givenroot.protected com.google.gson.JsonElementtoElement(com.google.gson.JsonObject value) toString()Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.hibernate.search.backend.elasticsearch.gson.impl.JsonAccessor
get, getOrCreate, set
-
Constructor Details
-
JsonObjectAccessorImpl
-
-
Method Details
-
getExpectedElementType
-
getOrCreate
public com.google.gson.JsonObject getOrCreate(com.google.gson.JsonObject root) -
property
- Specified by:
propertyin interfaceJsonObjectAccessor
-
get
Description copied from interface:JsonAccessorGet the current value of the element this accessor points to for the givenroot.- Parameters:
root- The root to be accessed.- Returns:
- An
Optionalcontaining the current value pointed to by this accessor on theroot, orOptional.empty()if it doesn't exist.
-
set
public void set(com.google.gson.JsonObject root, com.google.gson.JsonObject newValue) Description copied from interface:JsonAccessorSet the given value on the element this accessor points to for the givenroot.- Parameters:
root- The root to be accessed.newValue- The value to set.
-
getOrCreate
public com.google.gson.JsonObject getOrCreate(com.google.gson.JsonObject root, Supplier<? extends com.google.gson.JsonObject> newValueSupplier) Description copied from interface:JsonAccessorGet the current value of the element this accessor points to for the givenroot, creating it and setting it if it hasn't been set yet.- Parameters:
root- The root to be accessed.newValueSupplier- The value to set and return if the current value hasn't been set yet.- Returns:
- The current value pointed to by this accessor on the
root, always non-null.
-
toElement
protected com.google.gson.JsonElement toElement(com.google.gson.JsonObject value) -
appendRuntimeRelativePath
-
appendStaticRelativePath
-
getParentAccessor
-
toString
-