Class JsonIntegerAccessor

    • Constructor Detail

      • JsonIntegerAccessor

        public JsonIntegerAccessor​(JsonAccessor<com.google.gson.JsonElement> parentAccessor)
    • Method Detail

      • get

        public Optional<T> 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,
                        T 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 T getOrCreate​(com.google.gson.JsonObject root,
                             Supplier<? extends T> 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​(T value)
      • appendRuntimeRelativePath

        protected void appendRuntimeRelativePath​(StringBuilder path)
      • appendStaticRelativePath

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

        protected JsonAccessor<P> getParentAccessor()