Class JsonStringAccessor
java.lang.Object
org.hibernate.search.backend.elasticsearch.gson.impl.JsonStringAccessor
- All Implemented Interfaces:
JsonAccessor<String>
-
Constructor Summary
ConstructorsConstructorDescriptionJsonStringAccessor(JsonAccessor<com.google.gson.JsonElement> parentAccessor) -
Method Summary
Modifier and TypeMethodDescriptionprotected voidprotected voidappendStaticRelativePath(StringBuilder path, boolean first) get(com.google.gson.JsonObject root) Get the current value of the element this accessor points to for the givenroot.protected JsonElementType<String>getOrCreate(com.google.gson.JsonObject root, Supplier<? extends String> 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 the given value on the element this accessor points to for the givenroot.protected com.google.gson.JsonElementtoString()
-
Constructor Details
-
JsonStringAccessor
-
-
Method Details
-
getExpectedElementType
-
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
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 String getOrCreate(com.google.gson.JsonObject root, Supplier<? extends String> 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
-
appendRuntimeRelativePath
-
appendStaticRelativePath
-
getParentAccessor
-
toString
-