Class JsonArrayImpl
- java.lang.Object
-
- org.apache.activemq.artemis.json.impl.JsonValueImpl
-
- org.apache.activemq.artemis.json.impl.JsonArrayImpl
-
- All Implemented Interfaces:
Iterable<JsonValue>,Collection<JsonValue>,List<JsonValue>,JsonArray,JsonValue
public class JsonArrayImpl extends JsonValueImpl implements JsonArray
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.apache.activemq.artemis.json.JsonValue
JsonValue.ValueType
-
-
Field Summary
-
Fields inherited from interface org.apache.activemq.artemis.json.JsonValue
EMPTY_JSON_ARRAY, EMPTY_JSON_OBJECT, FALSE, NULL, TRUE
-
-
Constructor Summary
Constructors Constructor Description JsonArrayImpl(javax.json.JsonArray rawArray)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidadd(int index, JsonValue element)booleanadd(JsonValue jsonValue)booleanaddAll(int index, Collection<? extends JsonValue> c)booleanaddAll(Collection<? extends JsonValue> c)voidclear()booleancontains(Object o)booleancontainsAll(Collection<?> c)JsonValueget(int index)booleangetBoolean(int index)booleangetBoolean(int index, boolean defaultValue)intgetInt(int index)intgetInt(int index, int defaultValue)JsonArraygetJsonArray(int index)JsonNumbergetJsonNumber(int index)JsonObjectgetJsonObject(int index)JsonStringgetJsonString(int index)javax.json.JsonArraygetRawArray()StringgetString(int index)StringgetString(int index, String defaultValue)<T extends JsonValue>
List<T>getValuesAs(Class<T> clazz)intindexOf(Object o)booleanisEmpty()booleanisNull(int index)Iterator<JsonValue>iterator()intlastIndexOf(Object o)ListIterator<JsonValue>listIterator()ListIterator<JsonValue>listIterator(int index)JsonValueremove(int index)booleanremove(Object o)booleanremoveAll(Collection<?> c)booleanretainAll(Collection<?> c)JsonValueset(int index, JsonValue element)intsize()List<JsonValue>subList(int fromIndex, int toIndex)Object[]toArray()<T> T[]toArray(T[] a)-
Methods inherited from class org.apache.activemq.artemis.json.impl.JsonValueImpl
asJsonArray, asJsonObject, equals, getRawValue, getValueType, hashCode, toString, wrap
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface java.util.Collection
parallelStream, removeIf, stream, toArray
-
Methods inherited from interface org.apache.activemq.artemis.json.JsonArray
getValuesAs
-
Methods inherited from interface org.apache.activemq.artemis.json.JsonValue
asJsonArray, asJsonObject, getValueType, toString
-
Methods inherited from interface java.util.List
equals, hashCode, replaceAll, sort, spliterator
-
-
-
-
Method Detail
-
getRawArray
public javax.json.JsonArray getRawArray()
-
getJsonObject
public JsonObject getJsonObject(int index)
- Specified by:
getJsonObjectin interfaceJsonArray- Returns:
- the JsonObject at the given position
-
getJsonArray
public JsonArray getJsonArray(int index)
- Specified by:
getJsonArrayin interfaceJsonArray- Returns:
- the JsonArray at the given position
-
getJsonNumber
public JsonNumber getJsonNumber(int index)
- Specified by:
getJsonNumberin interfaceJsonArray- Returns:
- the JsonNumber at the given position
-
getJsonString
public JsonString getJsonString(int index)
- Specified by:
getJsonStringin interfaceJsonArray- Returns:
- the JsonString at the given position
-
getValuesAs
public <T extends JsonValue> List<T> getValuesAs(Class<T> clazz)
- Specified by:
getValuesAsin interfaceJsonArray- Returns:
- the respective JsonValue at the given position
-
getString
public String getString(int index)
-
getInt
public int getInt(int index)
-
getInt
public int getInt(int index, int defaultValue)
-
getBoolean
public boolean getBoolean(int index)
- Specified by:
getBooleanin interfaceJsonArray- Returns:
- the native boolean value at the given position
-
getBoolean
public boolean getBoolean(int index, boolean defaultValue)- Specified by:
getBooleanin interfaceJsonArray- Returns:
- the native boolean value at the given position or the defaultValue if null
-
isNull
public boolean isNull(int index)
- Specified by:
isNullin interfaceJsonArray- Returns:
- whether the value at the given position is
JsonValue.NULL.
-
size
public int size()
-
isEmpty
public boolean isEmpty()
-
contains
public boolean contains(Object o)
-
toArray
public Object[] toArray()
-
toArray
public <T> T[] toArray(T[] a)
-
add
public boolean add(JsonValue jsonValue)
-
remove
public boolean remove(Object o)
-
containsAll
public boolean containsAll(Collection<?> c)
- Specified by:
containsAllin interfaceCollection<JsonValue>- Specified by:
containsAllin interfaceList<JsonValue>
-
addAll
public boolean addAll(Collection<? extends JsonValue> c)
-
addAll
public boolean addAll(int index, Collection<? extends JsonValue> c)
-
removeAll
public boolean removeAll(Collection<?> c)
-
retainAll
public boolean retainAll(Collection<?> c)
-
clear
public void clear()
-
lastIndexOf
public int lastIndexOf(Object o)
- Specified by:
lastIndexOfin interfaceList<JsonValue>
-
listIterator
public ListIterator<JsonValue> listIterator()
- Specified by:
listIteratorin interfaceList<JsonValue>
-
listIterator
public ListIterator<JsonValue> listIterator(int index)
- Specified by:
listIteratorin interfaceList<JsonValue>
-
-