java.lang.Object
org.hibernate.search.backend.elasticsearch.gson.impl.JsonLongAccessor
All Implemented Interfaces:
JsonAccessor<Long>

public class JsonLongAccessor extends Object
  • Constructor Details

    • JsonLongAccessor

      public JsonLongAccessor(JsonAccessor<com.google.gson.JsonElement> parentAccessor)
  • Method Details

    • getExpectedElementType

      protected JsonElementType<Long> getExpectedElementType()
    • get

      public Optional<Long> get(com.google.gson.JsonObject root)
      Description copied from interface: JsonAccessor
      Get the current value of the element this accessor points to for the given root.
      Parameters:
      root - The root to be accessed.
      Returns:
      An Optional containing the current value pointed to by this accessor on the root, or Optional.empty() if it doesn't exist.
    • set

      public void set(com.google.gson.JsonObject root, Long newValue)
      Description copied from interface: JsonAccessor
      Set the given value on the element this accessor points to for the given root.
      Parameters:
      root - The root to be accessed.
      newValue - The value to set.
    • getOrCreate

      public Long getOrCreate(com.google.gson.JsonObject root, Supplier<? extends Long> newValueSupplier)
      Description copied from interface: JsonAccessor
      Get the current value of the element this accessor points to for the given root, 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(Long value)
    • appendRuntimeRelativePath

      protected void appendRuntimeRelativePath(StringBuilder path)
    • appendStaticRelativePath

      protected void appendStaticRelativePath(StringBuilder path, boolean first)
    • getParentAccessor

      protected JsonAccessor<com.google.gson.JsonElement> getParentAccessor()
    • toString

      public String toString()
      Overrides:
      toString in class Object