Uses of Interface
jsonvalues.JsElem
-
-
Uses of JsElem in jsonvalues
Subinterfaces of JsElem in jsonvalues Modifier and Type Interface Description interface
JsArray
Represents a json array, which is an ordered list of elements.interface
JsNumber
Represents an immutable json number.interface
JsObj
Represents a json object, which is an unordered set of name/element pairs.interface
Json<T extends Json<T>>
Represents a json of type T, where T is the type of the container, either a JsObj or a JsArray.Classes in jsonvalues that implement JsElem Modifier and Type Class Description class
JsBigDec
Represents an immutable json number of type BigDecimal.class
JsBigInt
Represents an immutable json number of type BigInteger.class
JsBool
Represents an immutable json boolean.class
JsDouble
Represents an immutable json number of type double.class
JsInt
Represents an immutable json number of type integer.class
JsLong
Represents an immutable json number of type long.class
JsNothing
It's a special json element that represents 'nothing'.class
JsNull
Represents null, which a valid json value.class
JsStr
Represents an immutable json string.Fields in jsonvalues declared as JsElem Modifier and Type Field Description JsElem
JsPair. elem
the json element.Methods in jsonvalues that return JsElem Modifier and Type Method Description default JsElem
Json. get(JsPath path)
Returns the element located at the given path orJsNothing
if it doesn't exist.JsElem
Json. get(Position position)
Returns the element located at the key or index specified by the given position orJsNothing
if it doesn't exist.JsElem
JsArray. head()
Returns the first element of this array.JsElem
JsArray. last()
Returns the last element of this array.Methods in jsonvalues that return types with arguments of type JsElem Modifier and Type Method Description static Consumer<JsElem>
MatchExp. accept(Consumer<JsElem> ifValue, Consumer<JsObj> ifObj, Consumer<JsArray> ifArray)
Declarative way of consuming an element based on its typeMap.Entry<String,JsElem>
JsObj. head()
Returns a pair with an arbitrary key of this object and its associated element.static <T> Function<JsElem,T>
MatchExp. ifArrElse(Function<? super JsArray,T> ifArr, Function<? super JsElem,T> ifNotArr)
return a matching expression to extract arrays out of json elements.static <T> Function<JsElem,T>
MatchExp. ifBoolElse(Function<? super Boolean,T> ifBoolean, Function<? super JsElem,T> ifNotBoolean)
return a matching expression to extract booleans out of json elements.static <T> Function<JsElem,T>
MatchExp. ifDecimalElse(DoubleFunction<T> ifDouble, Function<BigDecimal,T> ifBigDecimal, Function<? super JsElem,T> ifOther)
return a matching expression to extract decimal numbers out of json elements.static <T> Function<JsElem,T>
MatchExp. ifIntegralElse(IntFunction<T> ifInt, LongFunction<T> ifLong, Function<BigInteger,T> ifBigInt, Function<? super JsElem,T> ifOther)
return a matching expression to extract integral numbers out of json elements.static <T> Function<JsElem,T>
MatchExp. ifJsonElse(Function<? super JsObj,T> ifObj, Function<? super JsArray,T> ifArr, Function<? super JsElem,T> ifValue)
return a matching expression to extract objs and arrays out of json elements.static <T> Function<JsElem,T>
MatchExp. ifJsonElse(Function<Json<?>,T> ifJson, Function<JsElem,T> ifNotJson)
return a matching expression to extract jsons out of json elements.static <T> Function<JsElem,T>
MatchExp. ifNothingElse(Supplier<T> nothingSupplier, Function<JsElem,T> elseFn)
return a matching expression to extract JsNothing out of json elements.static <T> Function<JsElem,T>
MatchExp. ifObjElse(Function<? super JsObj,T> ifObj, Function<? super JsElem,T> ifNotObj)
return a matching expression to extract json objects out of json elements.static <T> Function<JsElem,T>
MatchExp. ifPredicateElse(Predicate<JsElem> predicate, Function<JsElem,T> ifTrue, Function<JsElem,T> ifFalse)
declarative way of implementing an if-else using high order functionsstatic <T> Function<JsElem,T>
MatchExp. ifStrElse(Function<? super String,T> ifStr, Function<? super JsElem,T> ifNotStr)
returns a matching expression to extract strings out of json elements.Methods in jsonvalues with parameters of type JsElem Modifier and Type Method Description static JsArray
JsArray. _of_(JsElem e)
Returns a mutable one-element array.static JsArray
JsArray. _of_(JsElem e, JsElem e1)
Returns a mutable two-element array.static JsArray
JsArray. _of_(JsElem e, JsElem e1, JsElem e2)
Returns a mutable three-element array.static JsArray
JsArray. _of_(JsElem e, JsElem e1, JsElem e2, JsElem e3)
Returns a mutable four-element array.static JsArray
JsArray. _of_(JsElem e, JsElem e1, JsElem e2, JsElem e3, JsElem e4)
Returns a mutable five-element array.static JsArray
JsArray. _of_(JsElem e, JsElem e1, JsElem e2, JsElem e3, JsElem e4, JsElem... rest)
Returns a mutable array containing an arbitrary number of elements.static JsObj
JsObj. _of_(String key, JsElem el)
Returns a mutable one-pair object.static JsObj
JsObj. _of_(String key1, JsElem el1, String key2, JsElem el2)
Returns a mutable two-pair object.static JsObj
JsObj. _of_(String key1, JsElem el1, String key2, JsElem el2, String key3, JsElem el3)
Returns a mutable three-pair object.static JsObj
JsObj. _of_(String key1, JsElem el1, String key2, JsElem el2, String key3, JsElem el3, String key4, JsElem el4)
Returns a mutable four-pair object.static JsObj
JsObj. _of_(String key1, JsElem el1, String key2, JsElem el2, String key3, JsElem el3, String key4, JsElem el4, String key5, JsElem el5)
Returns a mutable five-pair object.static JsObj
JsObj. _of_(String key1, JsElem el1, String key2, JsElem el2, String key3, JsElem el3, String key4, JsElem el4, String key5, JsElem el5, String key6, JsElem el6)
Returns a mutable six-pair object.JsArray
JsArray. add(int index, JsElem elem)
default T
Json. add(JsPath path, JsElem elem)
Inserts the given element at the given path in this json, replacing any existing element at that path.Patch.Builder
Patch.Builder. add(String path, JsElem value)
ADD operation.JsArray
JsArray. append(JsElem elem, JsElem... others)
Adds one or more elements, starting from the first, to the back of this array.T
Json. append(JsPath path, JsElem elem)
Appends one element to the array located at the given path in this json.default T
Json. append(JsPath path, JsElem elem, JsElem... others)
Appends one or more elements, starting from the first, to the array located at the given path in this json.boolean
Json. containsElem(JsElem element)
Returns true if this json contains the given element in the first level.default boolean
Json. containsElem_(JsElem element)
Returns true if this json or any of its elements, contains the given element.default boolean
Json. equals(JsElem elem, JsArray.TYPE ARRAY_AS)
default boolean
JsElem. isSameType(JsElem that)
returns true if this elem and the given have the same typedefault T
Json. merge(JsPath path, JsElem value, BiFunction<? super JsElem,? super JsElem,? extends JsElem> fn)
If the given path is not already associated with a value or is associated with null, associates it with the given value.static JsArray
JsArray. of(JsElem e)
Returns an immutable one-element array.static JsArray
JsArray. of(JsElem e, JsElem e1)
Returns an immutable two-element array.static JsArray
JsArray. of(JsElem e, JsElem e1, JsElem e2)
Returns an immutable three-element array.static JsArray
JsArray. of(JsElem e, JsElem e1, JsElem e2, JsElem e3)
Returns an immutable four-element array.static JsArray
JsArray. of(JsElem e, JsElem e1, JsElem e2, JsElem e3, JsElem e4)
Returns an immutable five-element array.static JsArray
JsArray. of(JsElem e, JsElem e1, JsElem e2, JsElem e3, JsElem e4, JsElem... rest)
Returns an immutable array.static JsObj
JsObj. of(String key, JsElem el)
Returns an immutable one-element object.static JsObj
JsObj. of(String key1, JsElem el1, String key2, JsElem el2)
Returns a two-element immutable object.static JsObj
JsObj. of(String key1, JsElem el1, String key2, JsElem el2, String key3, JsElem el3)
Returns a three-element immutable json object.static JsObj
JsObj. of(String key1, JsElem el1, String key2, JsElem el2, String key3, JsElem el3, String key4, JsElem el4)
Returns a four-element immutable object.static JsObj
JsObj. of(String key1, JsElem el1, String key2, JsElem el2, String key3, JsElem el3, String key4, JsElem el4, String key5, JsElem el5)
Returns a five-element immutable object.static JsObj
JsObj. of(String key1, JsElem el1, String key2, JsElem el2, String key3, JsElem el3, String key4, JsElem el4, String key5, JsElem el5, String key6, JsElem el6)
Returns a six-element immutable object.static JsPair
JsPair. of(JsPath path, JsElem elem)
Returns a json pair from the path and the json element.JsArray
JsArray. prepend(JsElem elem, JsElem... others)
Adds one or more elements, starting from the last, to the front of this array.T
Json. prepend(JsPath path, JsElem elem)
prepends one element to the array located at the path in this json.default T
Json. prepend(JsPath path, JsElem elem, JsElem... others)
prepends one or more elements, starting from the first, to the array located at the path in this json.default T
Json. put(JsPath path, JsElem element)
Inserts the element at the path in this json, replacing any existing element and filling withJsNull
empty indexes in arrays when necessary.Patch.Builder
Patch.Builder. replace(String path, JsElem value)
REPLACE operation.Patch.Builder
Patch.Builder. test(String path, JsElem value)
TEST operation.default long
Json. times(JsElem e)
default long
Json. times_(JsElem e)
Method parameters in jsonvalues with type arguments of type JsElem Modifier and Type Method Description static JsArray
JsArray. _of_(List<JsElem> list)
Returns a mutable array copying the reference of the collection of elements.static JsObj
JsObj. _of_(Map<String,JsElem> map)
Returns a mutable object from a map of elements.static Consumer<JsElem>
MatchExp. accept(Consumer<JsElem> ifValue, Consumer<JsObj> ifObj, Consumer<JsArray> ifArray)
Declarative way of consuming an element based on its typeT
Json. add(JsPath path, Function<? super JsElem,? extends JsElem> fn)
Inserts the element returned by the function at the given path in this json, replacing any existing element at that path.T
Json. add(JsPath path, Function<? super JsElem,? extends JsElem> fn)
Inserts the element returned by the function at the given path in this json, replacing any existing element at that path.default T
Json. appendIfPresent(JsPath path, Supplier<? extends JsElem> supplier)
Appends the element given by the supplier, to the array located at the given path in this json, returning the same this instance if the array is not present.default <T> Trampoline<T>
JsArray. ifEmptyElse(Trampoline<T> empty, BiFunction<JsElem,JsArray,Trampoline<T>> fn)
default <T> Trampoline<T>
JsObj. ifEmptyElse(Trampoline<T> empty, BiFunction<Map.Entry<String,JsElem>,JsObj,Trampoline<T>> fn)
static <T> Function<JsElem,T>
MatchExp. ifNothingElse(Supplier<T> nothingSupplier, Function<JsElem,T> elseFn)
return a matching expression to extract JsNothing out of json elements.static <T> Function<JsElem,T>
MatchExp. ifPredicateElse(Predicate<JsElem> predicate, Function<JsElem,T> ifTrue, Function<JsElem,T> ifFalse)
declarative way of implementing an if-else using high order functionsstatic <T> Function<JsElem,T>
MatchExp. ifPredicateElse(Predicate<JsElem> predicate, Function<JsElem,T> ifTrue, Function<JsElem,T> ifFalse)
declarative way of implementing an if-else using high order functionsJsPair
JsPair. mapElem(UnaryOperator<JsElem> map)
Returns a new pair with the same path and a new element result of applying the mapping functionT
Json. mapElems(Function<? super JsPair,? extends JsElem> fn)
Maps the values in the first level parse this json.T
Json. mapElems(Function<? super JsPair,? extends JsElem> fn, Predicate<? super JsPair> predicate)
Maps the values in the first level parse this json that satisfies a given predicate.T
Json. mapElems_(Function<? super JsPair,? extends JsElem> fn)
Maps all the values parse this json.T
Json. mapElems_(Function<? super JsPair,? extends JsElem> fn, Predicate<? super JsPair> predicate)
Maps all the values parse this json that satisfies a given predicate.default T
Json. merge(JsPath path, JsElem value, BiFunction<? super JsElem,? super JsElem,? extends JsElem> fn)
If the given path is not already associated with a value or is associated with null, associates it with the given value.default T
Json. merge(JsPath path, JsElem value, BiFunction<? super JsElem,? super JsElem,? extends JsElem> fn)
If the given path is not already associated with a value or is associated with null, associates it with the given value.default T
Json. merge(JsPath path, JsElem value, BiFunction<? super JsElem,? super JsElem,? extends JsElem> fn)
If the given path is not already associated with a value or is associated with null, associates it with the given value.static JsArray
JsArray. of(Collection<? extends JsElem> list)
Returns an immutable array from the collection of elements.static JsObj
JsObj. of(Map<String,JsElem> map)
Returns a immutable object from a map of elements.default T
Json. prependIfPresent(JsPath path, Supplier<JsElem> supplier)
Prepends one element given by a supplier, to the array located at the given path in this json, returning the same this instance if the array is not present.T
Json. put(JsPath path, Function<? super JsElem,? extends JsElem> fn)
Inserts the element returned by the function at the given path in this json, replacing any existing element and filling withJsNull
empty indexes in arrays when necessary.T
Json. put(JsPath path, Function<? super JsElem,? extends JsElem> fn)
Inserts the element returned by the function at the given path in this json, replacing any existing element and filling withJsNull
empty indexes in arrays when necessary.default T
Json. putIf(Predicate<? super JsElem> predicate, JsPath path, Function<? super JsElem,? extends JsElem> fn)
Inserts at the given path in this json, if the existing element satisfies the predicate, a new element returned by the function.default T
Json. putIf(Predicate<? super JsElem> predicate, JsPath path, Function<? super JsElem,? extends JsElem> fn)
Inserts at the given path in this json, if the existing element satisfies the predicate, a new element returned by the function.default T
Json. putIf(Predicate<? super JsElem> predicate, JsPath path, Function<? super JsElem,? extends JsElem> fn)
Inserts at the given path in this json, if the existing element satisfies the predicate, a new element returned by the function.default T
Json. putIfAbsent(JsPath path, Supplier<? extends JsElem> supplier)
Inserts at the given path in this json, if no element is present, the element returned by the supplier, replacing any existing element in the path and filling withJsNull
empty positions in arrays when necessary.default T
Json. putIfPresent(JsPath path, Function<? super JsElem,? extends JsElem> fn)
Inserts at the given path in this json, if some element is present, the element returned by the function.default T
Json. putIfPresent(JsPath path, Function<? super JsElem,? extends JsElem> fn)
Inserts at the given path in this json, if some element is present, the element returned by the function.ParseBuilder
ParseBuilder. withElemMap(Function<? super JsPair,? extends JsElem> map)
adds a function to this builder to map the elements of the json.
-