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(String path)
Returns the element located at the given path orJsNothing
if it doesn't exist.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 Map.Entry<String,JsElem>
JsObj. head()
Returns a pair with an arbitrary key of this object and its associated element.static <T> Function<JsElem,T>
MatchFns. ifArrElse(Function<? super JsArray,T> ifArr, Function<? super JsElem,T> ifNotArr)
Declarative way of implementing if(this.isArray()) return ifArr.apply(this.asJsArray()) else return ifNotArr.apply(this)static <T> Function<JsElem,T>
MatchFns. ifBoolElse(Function<? super Boolean,T> ifBoolean, Function<? super JsElem,T> ifNotBoolean)
Declarative way of implementing if(this.isBool()) return ifBoolean.get() else ifNotBoolean.get()static <T> Function<JsElem,T>
MatchFns. ifDecimalElse(DoubleFunction<T> ifDouble, Function<BigDecimal,T> ifBigDecimal, Function<? super JsElem,T> ifOther)
Declarative way of returning an object based on the type of decimal number this element isstatic <T> Function<JsElem,T>
MatchFns. ifIntegralElse(IntFunction<T> ifInt, LongFunction<T> ifLong, Function<BigInteger,T> ifBigInt, Function<? super JsElem,T> ifOther)
static <T> Function<JsElem,T>
MatchFns. ifJsonElse(Function<? super JsObj,T> ifObj, Function<? super JsArray,T> ifArr, Function<? super JsElem,T> ifValue)
static <T> Function<JsElem,T>
MatchFns. ifJsonElse(Function<Json<?>,T> ifJson, Function<JsElem,T> ifNotJson)
static <T> Function<JsElem,T>
MatchFns. ifNothingElse(Supplier<T> nothingSupplier, Function<JsElem,T> elseFn)
static <T> Function<JsElem,T>
MatchFns. ifObjElse(Function<? super JsObj,T> ifObj, Function<? super JsElem,T> ifNotObj)
static <T> Function<JsElem,T>
MatchFns. ifPredicateElse(Predicate<JsElem> predicate, Function<JsElem,T> ifTrue, Function<JsElem,T> ifFalse)
static <T> Function<JsElem,T>
MatchFns. ifStrElse(Function<? super String,T> ifStr, Function<? super JsElem,T> ifNotStr)
static Predicate<JsElem>
MatchFns. isSameType(JsElem that)
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. append(JsElem elem, JsElem... others)
Adds one or more elements, starting from the first, to the back of this array.default T
Json. append(String path, JsElem elem)
Appends one element to the array located at the given path in this json.default T
Json. append(String 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.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)
static Predicate<JsElem>
MatchFns. isSameType(JsElem that)
default T
Json. merge(String 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(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(String path, JsElem elem)
Returns a json pair from the path-like string and the json element.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.default T
Json. prepend(String path, JsElem elem)
prepends one element to the array located at the path in this json.default T
Json. prepend(String path, JsElem elem, JsElem... others)
Prepends one or more elements, starting from the first, to the array located at the path in this json.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(String 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.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.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.default T
Json. appendIfPresent(String 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
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>
MatchFns. ifNothingElse(Supplier<T> nothingSupplier, Function<JsElem,T> elseFn)
static <T> Function<JsElem,T>
MatchFns. ifPredicateElse(Predicate<JsElem> predicate, Function<JsElem,T> ifTrue, Function<JsElem,T> ifFalse)
static <T> Function<JsElem,T>
MatchFns. ifPredicateElse(Predicate<JsElem> predicate, Function<JsElem,T> ifTrue, Function<JsElem,T> ifFalse)
JsPair
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(String 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(String 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(String 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.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(String 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.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.default T
Json. put(String path, Function<? super JsElem,? extends JsElem> fn)
Inserts the element returned by the function at the path in this json, replacing any existing element in the path and filling withJsNull
empty indexes in arrays when necessary.default T
Json. put(String path, Function<? super JsElem,? extends JsElem> fn)
Inserts the element returned by the function at the path in this json, replacing any existing element in the path 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 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 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, String 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, String 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, String 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. 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(String 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. 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(String 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(String 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.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.ParseOptions
ParseOptions. withElemMap(Function<JsPair,JsElem> map)
adds a function to this builder to map the elements of the json to be parsed
-