/*
* Copyright 2014 Red Hat, Inc.
*
* Red Hat licenses this file to you under the Apache License, version 2.0
* (the "License"); you may not use this file except in compliance with the
* License. You may obtain a copy of the License at:
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations
* under the License.
*/
package io.vertx.reactivex.core.json.pointer;
import java.util.Map;
import io.reactivex.Observable;
import io.reactivex.Flowable;
import io.reactivex.Single;
import io.reactivex.Completable;
import io.reactivex.Maybe;
The JsonPointerIterator is used by the read/write algorithms of the JsonPointer
to read/write the querying data structure
Every method takes the currentValue as parameter, representing the actual value held by the query algorithm.
Implementations of this interface should be stateless, so they can be reused
You can implement this interface to query the structure you want using json pointers
NOTE: This class has been automatically generated from the original
non RX-ified interface using Vert.x codegen. /**
* The JsonPointerIterator is used by the read/write algorithms of the {@link io.vertx.reactivex.core.json.pointer.JsonPointer} to read/write the querying data structure <br/>
*
* Every method takes the currentValue as parameter, representing the actual value held by the query algorithm.<br/>
*
* Implementations of this interface should be stateless, so they can be reused<br/>
*
* You can implement this interface to query the structure you want using json pointers
*
* <p/>
* NOTE: This class has been automatically generated from the {@link io.vertx.core.json.pointer.JsonPointerIterator original} non RX-ified interface using Vert.x codegen.
*/
@io.vertx.lang.rx.RxGen(io.vertx.core.json.pointer.JsonPointerIterator.class)
public class JsonPointerIterator {
@Override
public String toString() {
return delegate.toString();
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
JsonPointerIterator that = (JsonPointerIterator) o;
return delegate.equals(that.delegate);
}
@Override
public int hashCode() {
return delegate.hashCode();
}
public static final io.vertx.lang.rx.TypeArg<JsonPointerIterator> __TYPE_ARG = new io.vertx.lang.rx.TypeArg<>( obj -> new JsonPointerIterator((io.vertx.core.json.pointer.JsonPointerIterator) obj),
JsonPointerIterator::getDelegate
);
private final io.vertx.core.json.pointer.JsonPointerIterator delegate;
public JsonPointerIterator(io.vertx.core.json.pointer.JsonPointerIterator delegate) {
this.delegate = delegate;
}
public io.vertx.core.json.pointer.JsonPointerIterator getDelegate() {
return delegate;
}
Params: - currentValue –
Returns: true
if the current value is a queryable object
/**
* @param currentValue
* @return <code>true</code> if the current value is a queryable object
*/
public boolean isObject(Object currentValue) {
boolean ret = delegate.isObject(currentValue);
return ret;
}
Params: - currentValue –
Returns: true
if the current value is a queryable array
/**
* @param currentValue
* @return <code>true</code> if the current value is a queryable array
*/
public boolean isArray(Object currentValue) {
boolean ret = delegate.isArray(currentValue);
return ret;
}
Params: - currentValue –
Returns: true
if the current value is null/empty
/**
* @param currentValue
* @return <code>true</code> if the current value is null/empty
*/
public boolean isNull(Object currentValue) {
boolean ret = delegate.isNull(currentValue);
return ret;
}
Params: - currentValue –
- key – object key
Returns: true
if current value is a queryable object that contains the specified key
/**
* @param currentValue
* @param key object key
* @return <code>true</code> if current value is a queryable object that contains the specified key
*/
public boolean objectContainsKey(Object currentValue, String key) {
boolean ret = delegate.objectContainsKey(currentValue, key);
return ret;
}
Returns the object parameter with specified key.
Params: - currentValue –
- key – object key
- createOnMissing – If the current value is an object that doesn't contain the key, put an empty object at provided key
Returns: the requested object parameter, or null if the method was not able to find it
/**
* Returns the object parameter with specified key.
* @param currentValue
* @param key object key
* @param createOnMissing If the current value is an object that doesn't contain the key, put an empty object at provided key
* @return the requested object parameter, or null if the method was not able to find it
*/
public Object getObjectParameter(Object currentValue, String key, boolean createOnMissing) {
Object ret = (Object) delegate.getObjectParameter(currentValue, key, createOnMissing);
return ret;
}
Move the iterator the the array element at specified index
Params: - currentValue –
- i – array index
Returns: the request array element, or null if the method was not able to find it
/**
* Move the iterator the the array element at specified index
* @param currentValue
* @param i array index
* @return the request array element, or null if the method was not able to find it
*/
public Object getArrayElement(Object currentValue, int i) {
Object ret = (Object) delegate.getArrayElement(currentValue, i);
return ret;
}
Write object parameter at specified key
Params: - currentValue –
- key –
- value –
Returns: true if the operation is successful
/**
* Write object parameter at specified key
* @param currentValue
* @param key
* @param value
* @return true if the operation is successful
*/
public boolean writeObjectParameter(Object currentValue, String key, Object value) {
boolean ret = delegate.writeObjectParameter(currentValue, key, value);
return ret;
}
Write array element at specified index
Params: - currentValue –
- i –
- value –
Returns: true if the operation is successful
/**
* Write array element at specified index
* @param currentValue
* @param i
* @param value
* @return true if the operation is successful
*/
public boolean writeArrayElement(Object currentValue, int i, Object value) {
boolean ret = delegate.writeArrayElement(currentValue, i, value);
return ret;
}
Append array element
Params: - currentValue –
- value –
Returns: true if the operation is successful
/**
* Append array element
* @param currentValue
* @param value
* @return true if the operation is successful
*/
public boolean appendArrayElement(Object currentValue, Object value) {
boolean ret = delegate.appendArrayElement(currentValue, value);
return ret;
}
Instance of a JsonPointerIterator to query Vert.x Json structures
/**
* Instance of a JsonPointerIterator to query Vert.x Json structures
*/
public static final JsonPointerIterator JSON_ITERATOR = io.vertx.reactivex.core.json.pointer.JsonPointerIterator.newInstance(io.vertx.core.json.pointer.JsonPointerIterator.JSON_ITERATOR);
public static JsonPointerIterator newInstance(io.vertx.core.json.pointer.JsonPointerIterator arg) {
return arg != null ? new JsonPointerIterator(arg) : null;
}
}