Uses of Interface
jsonvalues.JsValue
-
Packages that use JsValue Package Description jsonvalues json-values is a one-package and zero-dependency library to work with jsons in a declarative and functional way. -
-
Uses of JsValue in jsonvalues
Subinterfaces of JsValue in jsonvalues Modifier and Type Interface Description 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 JsValue Modifier and Type Class Description class
JsArray
Represents a json array, which is an ordered list of elements.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
JsObj
Represents a json object, which is an unordered set of name/element pairs.class
JsStr
Represents an immutable json string.Fields in jsonvalues declared as JsValue Modifier and Type Field Description JsValue
JsPair. value
the json element.Methods in jsonvalues that return JsValue Modifier and Type Method Description JsValue
JsArray. get(int i)
JsValue
JsArray. get(Position pos)
JsValue
JsObj. get(Position position)
default JsValue
Json. get(JsPath path)
Returns the element located at the given path orJsNothing
if it doesn't exist.JsValue
Json. get(Position position)
Returns the element located at the key or index specified by the given position orJsNothing
if it doesn't exist.JsValue
JsArray. head()
Returns the first element of this array.JsValue
JsArray. last()
Returns the last element of this array.Methods in jsonvalues that return types with arguments of type JsValue Modifier and Type Method Description static Consumer<JsValue>
MatchExp. accept(Consumer<JsValue> ifValue, Consumer<JsObj> ifObj, Consumer<JsArray> ifArray)
Declarative way of consuming an element based on its typeio.vavr.Tuple2<String,JsValue>
JsObj. head()
Returns a pair with an arbitrary key of this object and its associated element.static <T> Function<JsValue,T>
MatchExp. ifArrElse(Function<? super JsArray,T> ifArr, Function<? super JsValue,T> ifNotArr)
return a matching expression to extract arrays out of json elements.static <T> Function<JsValue,T>
MatchExp. ifBoolElse(Function<? super Boolean,T> ifBoolean, Function<? super JsValue,T> ifNotBoolean)
return a matching expression to extract booleans out of json elements.static <T> Function<JsValue,T>
MatchExp. ifDecimalElse(DoubleFunction<T> ifDouble, Function<BigDecimal,T> ifBigDecimal, Function<? super JsValue,T> ifOther)
return a matching expression to extract decimal numbers out of json elements.static <T> Function<JsValue,T>
MatchExp. ifIntegralElse(IntFunction<T> ifInt, LongFunction<T> ifLong, Function<BigInteger,T> ifBigInt, Function<? super JsValue,T> ifOther)
return a matching expression to extract integral numbers out of json elements.static <T> Function<JsValue,T>
MatchExp. ifJsonElse(Function<? super JsObj,T> ifObj, Function<? super JsArray,T> ifArr, Function<? super JsValue,T> ifValue)
return a matching expression to extract objs and arrays out of json elements.static <T> Function<JsValue,T>
MatchExp. ifJsonElse(Function<Json<?>,T> ifJson, Function<JsValue,T> ifNotJson)
return a matching expression to extract jsons out of json elements.static <T> Function<JsValue,T>
MatchExp. ifNothingElse(Supplier<T> nothingSupplier, Function<JsValue,T> elseFn)
return a matching expression to extract JsNothing out of json elements.static <T> Function<JsValue,T>
MatchExp. ifObjElse(Function<? super JsObj,T> ifObj, Function<? super JsValue,T> ifNotObj)
return a matching expression to extract json objects out of json elements.static <T> Function<JsValue,T>
MatchExp. ifPredicateElse(Predicate<JsValue> predicate, Function<JsValue,T> ifTrue, Function<JsValue,T> ifFalse)
declarative way of implementing an if-else using high order functionsstatic <T> Function<JsValue,T>
MatchExp. ifStrElse(Function<? super String,T> ifStr, Function<? super JsValue,T> ifNotStr)
returns a matching expression to extract strings out of json elements.Iterator<JsValue>
JsArray. iterator()
Iterator<io.vavr.Tuple2<String,JsValue>>
JsObj. iterator()
Methods in jsonvalues with parameters of type JsValue Modifier and Type Method Description JsArray
JsArray. append(JsPath path, JsValue elem)
JsArray
JsArray. append(JsValue e, JsValue... others)
Adds one or more elements, starting from the first, to the back of this array.JsObj
JsObj. append(JsPath path, JsValue elem)
T
Json. append(JsPath path, JsValue elem)
Appends one element to the array located at the given path in this json.default T
Json. append(JsPath path, JsValue elem, JsValue... others)
Appends one or more elements, starting from the first, to the array located at the given path in this json.boolean
JsArray. containsValue(JsValue el)
boolean
JsObj. containsValue(JsValue el)
boolean
Json. containsValue(JsValue element)
Returns true if this json contains the given element in the first level.default boolean
Json. equals(JsValue elem, JsArray.TYPE ARRAY_AS)
default boolean
JsValue. isSameType(JsValue that)
returns true if this elem and the given have the same typestatic JsArray
JsArray. of(JsValue e)
static JsArray
JsArray. of(JsValue e, JsValue e1)
Returns an immutable two-element array.static JsArray
JsArray. of(JsValue e, JsValue e1, JsValue e2)
Returns an immutable three-element array.static JsArray
JsArray. of(JsValue e, JsValue e1, JsValue e2, JsValue e3)
Returns an immutable four-element array.static JsArray
JsArray. of(JsValue e, JsValue e1, JsValue e2, JsValue e3, JsValue e4)
Returns an immutable five-element array.static JsArray
JsArray. of(JsValue e, JsValue e1, JsValue e2, JsValue e3, JsValue e4, JsValue... rest)
Returns an immutable array.static JsObj
JsObj. of(String key, JsValue el)
Returns a one-element immutable object.static JsObj
JsObj. of(String key1, JsValue el1, String key2, JsValue el2)
Returns a two-element immutable object.static JsObj
JsObj. of(String key1, JsValue el1, String key2, JsValue el2, String key3, JsValue el3)
Returns a three-element immutable object.static JsObj
JsObj. of(String key1, JsValue el1, String key2, JsValue el2, String key3, JsValue el3, String key4, JsValue el4)
Returns a four-element immutable object.static JsObj
JsObj. of(String key1, JsValue el1, String key2, JsValue el2, String key3, JsValue el3, String key4, JsValue el4, String key5, JsValue el5)
Returns a five-element immutable object.static JsObj
JsObj. of(String key1, JsValue el1, String key2, JsValue el2, String key3, JsValue el3, String key4, JsValue el4, String key5, JsValue el5, String key6, JsValue el6)
Returns a six-element immutable object.static JsPair
JsPair. of(JsPath path, JsValue elem)
Returns a json pair from the path and the json element.JsArray
JsArray. prepend(JsPath path, JsValue elem)
JsArray
JsArray. prepend(JsValue e, JsValue... others)
Adds one or more elements, starting from the last, to the front of this array.JsObj
JsObj. prepend(JsPath path, JsValue elem)
T
Json. prepend(JsPath path, JsValue elem)
prepends one element to the array located at the path in this json.default T
Json. prepend(JsPath path, JsValue elem, JsValue... 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, JsValue 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(JsValue e)
default long
Json. timesAll(JsValue e)
Method parameters in jsonvalues with type arguments of type JsValue Modifier and Type Method Description static Consumer<JsValue>
MatchExp. accept(Consumer<JsValue> ifValue, Consumer<JsObj> ifObj, Consumer<JsArray> ifArray)
Declarative way of consuming an element based on its typedefault T
Json. appendIfPresent(JsPath path, Supplier<? extends JsValue> 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.<T> Trampoline<T>
JsArray. ifEmptyElse(Trampoline<T> empty, BiFunction<JsValue,JsArray,Trampoline<T>> fn)
static <T> Function<JsValue,T>
MatchExp. ifNothingElse(Supplier<T> nothingSupplier, Function<JsValue,T> elseFn)
return a matching expression to extract JsNothing out of json elements.static <T> Function<JsValue,T>
MatchExp. ifPredicateElse(Predicate<JsValue> predicate, Function<JsValue,T> ifTrue, Function<JsValue,T> ifFalse)
declarative way of implementing an if-else using high order functionsstatic <T> Function<JsValue,T>
MatchExp. ifPredicateElse(Predicate<JsValue> predicate, Function<JsValue,T> ifTrue, Function<JsValue,T> ifFalse)
declarative way of implementing an if-else using high order functionsJsArray
JsArray. mapAllValues(Function<? super JsPair,? extends JsValue> fn)
JsArray
JsArray. mapAllValues(Function<? super JsPair,? extends JsValue> fn, Predicate<? super JsPair> predicate)
JsObj
JsObj. mapAllValues(Function<? super JsPair,? extends JsValue> fn)
JsObj
JsObj. mapAllValues(Function<? super JsPair,? extends JsValue> fn, Predicate<? super JsPair> predicate)
T
Json. mapAllValues(Function<? super JsPair,? extends JsValue> fn)
Maps all the values of this json.T
Json. mapAllValues(Function<? super JsPair,? extends JsValue> fn, Predicate<? super JsPair> predicate)
Maps all the values of this json that satisfies a given predicate.JsPair
JsPair. mapElem(UnaryOperator<JsValue> map)
Returns a new pair with the same path and a new element result of applying the mapping functionJsArray
JsArray. mapValues(Function<? super JsPair,? extends JsValue> fn)
JsArray
JsArray. mapValues(Function<? super JsPair,? extends JsValue> fn, Predicate<? super JsPair> predicate)
JsObj
JsObj. mapValues(Function<? super JsPair,? extends JsValue> fn)
JsObj
JsObj. mapValues(Function<? super JsPair,? extends JsValue> fn, Predicate<? super JsPair> predicate)
T
Json. mapValues(Function<? super JsPair,? extends JsValue> fn)
Maps the values in the first level of this json.T
Json. mapValues(Function<? super JsPair,? extends JsValue> fn, Predicate<? super JsPair> predicate)
Maps the values in the first level of this json that satisfies a given predicate.static JsArray
JsArray. ofIterable(Iterable<JsValue> iterable)
returns an immutable json array from an iterable of json elementsstatic JsObj
JsObj. ofIterable(Iterable<Map.Entry<String,JsValue>> xs)
default T
Json. prependIfPresent(JsPath path, Supplier<JsValue> 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.JsArray
JsArray. put(JsPath path, Function<? super JsValue,? extends JsValue> fn)
JsArray
JsArray. put(JsPath path, Function<? super JsValue,? extends JsValue> fn)
JsObj
JsObj. put(JsPath path, Function<? super JsValue,? extends JsValue> fn)
JsObj
JsObj. put(JsPath path, Function<? super JsValue,? extends JsValue> fn)
T
Json. put(JsPath path, Function<? super JsValue,? extends JsValue> 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 JsValue,? extends JsValue> 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 JsValue> predicate, JsPath path, Function<? super JsValue,? extends JsValue> 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 JsValue> predicate, JsPath path, Function<? super JsValue,? extends JsValue> 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 JsValue> predicate, JsPath path, Function<? super JsValue,? extends JsValue> 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 JsValue> 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 JsValue,? extends JsValue> 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 JsValue,? extends JsValue> 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 JsValue> map)
adds a function to this builder to map the elements of the json.
-