Package | Description |
---|---|
jsonvalues |
The `jsonvalues` package provides a set of classes and interfaces for working with JSON (JavaScript Object Notation) data in a type-safe and structured manner.
|
jsonvalues.gen |
This package contains a set of generators for creating JSON-like data structures using the `jsonvalues` library.
|
jsonvalues.spec |
The `jsonvalues.spec` package provides classes and interfaces for defining and working with JSON specifications (specs) and parsers.
|
Modifier and Type | Field and Description |
---|---|
static fun.optic.Prism<JsValue,JsArray> |
JsArray.prism
|
Modifier and Type | Method and Description |
---|---|
JsArray |
JsArray.append(JsValue e,
JsValue... others)
Appends one or more
JsValue elements to the end of this JSON array. |
JsArray |
JsArray.appendAll(JsArray array)
Appends all elements from another
JsArray to the end of this JSON array. |
JsArray |
JsArray.delete(int index)
Deletes the element at the specified index from this
JsArray . |
JsArray |
JsArray.delete(JsPath path) |
static JsArray |
JsArray.empty()
Returns the singleton empty JSON array
|
JsArray |
JsArray.filterKeys(BiPredicate<? super JsPath,? super JsValue> filter) |
JsArray |
JsArray.filterKeys(Predicate<? super String> filter) |
JsArray |
JsArray.filterObjs(BiPredicate<? super JsPath,? super JsObj> filter) |
JsArray |
JsArray.filterObjs(Predicate<? super JsObj> filter) |
JsArray |
JsArray.filterValues(BiPredicate<? super JsPath,? super JsPrimitive> filter) |
JsArray |
JsArray.filterValues(Predicate<? super JsPrimitive> filter) |
JsArray |
JsArray.getArray(int index)
Retrieves the value located at the specified index within the JSON-like array and attempts to
interpret it as a JSON array (JsArray).
|
JsArray |
JsArray.getArray(int index,
Supplier<JsArray> orElse)
Retrieves the value located at the specified index within the JSON-like array and attempts to
interpret it as a JSON array (JsArray).
|
default JsArray |
Json.getArray(JsPath path)
Returns the array located at the given path or null if it doesn't exist or it's not an array.
|
default JsArray |
Json.getArray(JsPath path,
Supplier<JsArray> orElse)
Returns the array located at the given path or the default value provided if it doesn't exist or it's not an array.
|
JsArray |
JsObj.getArray(String key)
Returns the array located at the given key or null if it doesn't exist, or it's not an array.
|
JsArray |
JsObj.getArray(String key,
Supplier<JsArray> orElse)
Returns the array located at the given key or the default value provided if it
doesn't exist, or it's not an array.
|
JsArray |
JsArray.init()
Returns all the elements of this array except the last one.
|
JsArray |
JsArray.intersection(JsArray that,
JsArray.TYPE ARRAY_AS)
this.union(that, SET) returns this plus those elements from that that
don't exist in this . |
JsArray |
JsArray.mapKeys(BiFunction<? super JsPath,? super JsValue,String> fn) |
JsArray |
JsArray.mapKeys(Function<? super String,String> fn) |
JsArray |
JsArray.mapObjs(BiFunction<? super JsPath,? super JsObj,? extends JsValue> fn) |
JsArray |
JsArray.mapObjs(Function<? super JsObj,? extends JsValue> fn) |
JsArray |
JsArray.mapValues(BiFunction<? super JsPath,? super JsPrimitive,? extends JsValue> fn) |
JsArray |
JsArray.mapValues(Function<? super JsPrimitive,? extends JsValue> fn) |
static JsArray |
JsArray.of(BigInteger number,
BigInteger... others)
Creates a new
JsArray containing the specified BigInteger elements. |
static JsArray |
JsArray.of(boolean bool,
boolean... others)
Creates a new
JsArray containing the specified boolean elements. |
static JsArray |
JsArray.of(double number,
double... others)
Creates a new
JsArray containing the specified double elements. |
static JsArray |
JsArray.of(int number,
int... others)
Creates a new
JsArray containing the specified integer elements. |
static JsArray |
JsArray.of(JsValue e,
JsValue... rest)
Creates a new
JsArray containing the specified elements. |
static JsArray |
JsArray.of(long number,
long... others)
Creates a new
JsArray containing the specified long elements. |
static JsArray |
JsArray.of(String str,
String... others)
Creates a new
JsArray containing the specified string elements. |
static JsArray |
JsArray.ofIterable(Iterable<? extends JsValue> iterable)
|
static JsArray |
JsArray.parse(byte[] bytes)
Parses a JSON array represented as a byte array and returns a new
JsArray instance. |
static JsArray |
JsArray.parse(String str)
Parses a JSON array represented as a string and returns a new
JsArray instance. |
JsArray |
JsArray.prepend(JsValue e,
JsValue... others)
Adds one or more elements, starting from the last, to the front of this array.
|
JsArray |
JsArray.prependAll(JsArray array)
Adds all the elements of the
JsArray , starting from the last, to the front of this array. |
JsArray |
JsArray.set(int index,
JsValue element) |
JsArray |
JsArray.set(int index,
JsValue value,
JsValue padElement)
Sets the value at the specified index within the JSON-like array to the provided JsValue.
|
JsArray |
JsArray.set(JsPath path,
JsValue element) |
JsArray |
JsArray.set(JsPath path,
JsValue value,
JsValue padElement) |
JsArray |
JsArray.tail()
Returns a JSON array consisting of all elements of this array except the first one.
|
default JsArray |
JsValue.toJsArray()
Returns this JsValue as a JsArray.
|
JsArray |
JsArray.union(JsArray that,
JsArray.TYPE ARRAY_AS) |
Modifier and Type | Method and Description |
---|---|
fun.optic.Lens<JsArray,JsArray> |
JsOptics.JsArrayLenses.array(int index)
lens that focus on the json array located at an index in an array
|
fun.optic.Lens<JsArray,JsArray> |
JsOptics.JsArrayLenses.array(int index)
lens that focus on the json array located at an index in an array
|
fun.optic.Option<JsArray,JsArray> |
JsOptics.JsArrayOptionals.array(int index)
optional that focus on the json array located at an index in an array
|
fun.optic.Option<JsArray,JsArray> |
JsOptics.JsArrayOptionals.array(int index)
optional that focus on the json array located at an index in an array
|
fun.optic.Lens<JsArray,JsArray> |
JsOptics.JsArrayLenses.array(JsPath path)
lens that focus on the json array located at a path in an array
|
fun.optic.Lens<JsArray,JsArray> |
JsOptics.JsArrayLenses.array(JsPath path)
lens that focus on the json array located at a path in an array
|
fun.optic.Option<JsArray,JsArray> |
JsOptics.JsArrayOptionals.array(JsPath path)
optional that focus on the array located at a path in an array
|
fun.optic.Option<JsArray,JsArray> |
JsOptics.JsArrayOptionals.array(JsPath path)
optional that focus on the array located at a path in an array
|
fun.optic.Option<JsObj,JsArray> |
JsOptics.JsObjOptional.array(JsPath path)
optional that focus on the array located at a path in an object
|
fun.optic.Lens<JsObj,JsArray> |
JsOptics.JsObjLenses.array(JsPath path)
lens that focus on a json object located at a path in an object.
|
fun.optic.Option<JsObj,JsArray> |
JsOptics.JsObjOptional.array(String key)
optional that focus on the array located at a key in an object
|
fun.optic.Lens<JsObj,JsArray> |
JsOptics.JsObjLenses.array(String key)
lens that focus on a json array located at a key in an object.
|
fun.optic.Lens<JsArray,byte[]> |
JsOptics.JsArrayLenses.binary(int index)
lens that focus on an array of bytes located at an index in an array
|
fun.optic.Lens<JsArray,byte[]> |
JsOptics.JsArrayLenses.binary(JsPath path)
lens that focus on an array of bytes located at a path in an array
|
fun.optic.Lens<JsArray,Boolean> |
JsOptics.JsArrayLenses.bool(int index)
lens that focus on the boolean located at an index in an array
|
fun.optic.Option<JsArray,Boolean> |
JsOptics.JsArrayOptionals.bool(int index)
optional that focus on the boolean located at an index in an array
|
fun.optic.Lens<JsArray,Boolean> |
JsOptics.JsArrayLenses.bool(JsPath path)
lens that focus on the boolean located at a path in an array
|
fun.optic.Option<JsArray,Boolean> |
JsOptics.JsArrayOptionals.bool(JsPath path)
optional that focus on the boolean located at a path in an array
|
fun.optic.Lens<JsArray,BigDecimal> |
JsOptics.JsArrayLenses.decimalNum(int index)
lens that focus on the decimal number located at an index in an array
|
fun.optic.Option<JsArray,BigDecimal> |
JsOptics.JsArrayOptionals.decimalNum(int index)
optional that focus on the decimal number located at an index in an array
|
fun.optic.Lens<JsArray,BigDecimal> |
JsOptics.JsArrayLenses.decimalNum(JsPath path)
lens that focus on the decimal number located at a path in an array
|
fun.optic.Option<JsArray,BigDecimal> |
JsOptics.JsArrayOptionals.decimalNum(JsPath path)
optional that focus on the decimal number located at a path in an array
|
fun.optic.Lens<JsArray,Double> |
JsOptics.JsArrayLenses.doubleNum(int index)
lens that focus on the double number located at an index in an array
|
fun.optic.Option<JsArray,Double> |
JsOptics.JsArrayOptionals.doubleNum(int index)
optional that focus on the double number located at an index in an array
|
fun.optic.Lens<JsArray,Double> |
JsOptics.JsArrayLenses.doubleNum(JsPath path)
lens that focus on the double number located at a path in an array
|
fun.optic.Option<JsArray,Double> |
JsOptics.JsArrayOptionals.doubleNum(JsPath path)
optional that focus on the double number located at a path in an array
|
fun.optic.Lens<JsArray,Instant> |
JsOptics.JsArrayLenses.instant(int index)
lens that focus on the array of bytes at an index in an array
|
fun.optic.Option<JsArray,Instant> |
JsOptics.JsArrayOptionals.instant(int index)
optional that focus on the instant located at an index in an array
|
fun.optic.Lens<JsArray,Instant> |
JsOptics.JsArrayLenses.instant(JsPath path)
lens that focus on the array of bytes located at a path in an array
|
fun.optic.Option<JsArray,Instant> |
JsOptics.JsArrayOptionals.instant(JsPath path)
optional that focus on the instant located at a path in an array
|
fun.optic.Lens<JsArray,BigInteger> |
JsOptics.JsArrayLenses.integralNum(int index)
lens that focus on the integral number located at an index in an array
|
fun.optic.Option<JsArray,BigInteger> |
JsOptics.JsArrayOptionals.integralNum(int index)
optional that focus on the integral number located at an index in an array
|
fun.optic.Lens<JsArray,BigInteger> |
JsOptics.JsArrayLenses.integralNum(JsPath path)
lens that focus on the integral number located at a path in an array
|
fun.optic.Option<JsArray,BigInteger> |
JsOptics.JsArrayOptionals.integralNum(JsPath path)
optional that focus on the integral number located at a path in an array
|
fun.optic.Lens<JsArray,Integer> |
JsOptics.JsArrayLenses.intNum(int index)
lens that focus on the integer number located at an index in an array
|
fun.optic.Option<JsArray,Integer> |
JsOptics.JsArrayOptionals.intNum(int index)
optional that focus on the integer number located at an index in an array
|
fun.optic.Lens<JsArray,Integer> |
JsOptics.JsArrayLenses.intNum(JsPath path)
lens that focus on the integer number located at a path in an array
|
fun.optic.Option<JsArray,Integer> |
JsOptics.JsArrayOptionals.intNum(JsPath path)
optional that focus on the integer number located at a path in an array
|
fun.optic.Lens<JsArray,Long> |
JsOptics.JsArrayLenses.longNum(int index)
lens that focus on the long number located at an index in an array
|
fun.optic.Option<JsArray,Long> |
JsOptics.JsArrayOptionals.longNum(int index)
optional that focus on the long number located at an index in an array
|
fun.optic.Lens<JsArray,Long> |
JsOptics.JsArrayLenses.longNum(JsPath path)
lens that focus on the long number located at a path in an array
|
fun.optic.Option<JsArray,Long> |
JsOptics.JsArrayOptionals.longNum(JsPath path)
optional that focus on the long number located at a path in an array
|
fun.optic.Lens<JsArray,JsObj> |
JsOptics.JsArrayLenses.obj(int index)
lens that focus on the json object located at an index in an array
|
fun.optic.Option<JsArray,JsObj> |
JsOptics.JsArrayOptionals.obj(int index)
optional that focus on the json object located at an index in an array
|
fun.optic.Lens<JsArray,JsObj> |
JsOptics.JsArrayLenses.obj(JsPath path)
lens that focus on the JSON object located at a path in an array
|
fun.optic.Option<JsArray,JsObj> |
JsOptics.JsArrayOptionals.obj(JsPath path)
optional that focus on the object located at a path in an array
|
fun.optic.Lens<JsArray,String> |
JsOptics.JsArrayLenses.str(int index)
lens that focus on the string located at an index in an array
|
fun.optic.Option<JsArray,String> |
JsOptics.JsArrayOptionals.str(int index)
optional that focus on the string located at an index in an array
|
fun.optic.Lens<JsArray,String> |
JsOptics.JsArrayLenses.str(JsPath path)
lens that focus on the string located at a path in an array
|
fun.optic.Option<JsArray,String> |
JsOptics.JsArrayOptionals.str(JsPath path)
optional that focus on the string located at a path in an array
|
fun.optic.Lens<JsArray,JsValue> |
JsOptics.JsArrayLenses.value(int index)
lens that focus on the value located at an index in an array
|
fun.optic.Lens<JsArray,JsValue> |
JsOptics.JsArrayLenses.value(JsPath path)
lens that focus on the value located at a path in an array
|
Modifier and Type | Method and Description |
---|---|
JsArray |
JsArray.appendAll(JsArray array)
Appends all elements from another
JsArray to the end of this JSON array. |
boolean |
JsArray.equals(JsArray array,
JsArray.TYPE ARRAY_AS)
Checks if this JSON array is equal to another JSON array.
|
JsArray |
JsArray.intersection(JsArray that,
JsArray.TYPE ARRAY_AS)
this.union(that, SET) returns this plus those elements from that that
don't exist in this . |
JsArray |
JsArray.prependAll(JsArray array)
Adds all the elements of the
JsArray , starting from the last, to the front of this array. |
JsArray |
JsArray.union(JsArray that,
JsArray.TYPE ARRAY_AS) |
Modifier and Type | Method and Description |
---|---|
JsArray |
JsArray.getArray(int index,
Supplier<JsArray> orElse)
Retrieves the value located at the specified index within the JSON-like array and attempts to
interpret it as a JSON array (JsArray).
|
default JsArray |
Json.getArray(JsPath path,
Supplier<JsArray> orElse)
Returns the array located at the given path or the default value provided if it doesn't exist or it's not an array.
|
JsArray |
JsObj.getArray(String key,
Supplier<JsArray> orElse)
Returns the array located at the given key or the default value provided if it
doesn't exist, or it's not an array.
|
default boolean |
JsValue.isArray(Predicate<JsArray> predicate)
Returns true if this element is a JsArray and satisfies the given predicate.
|
Modifier and Type | Method and Description |
---|---|
Supplier<JsArray> |
JsTupleGen.apply(Random seed) |
Supplier<JsArray> |
JsArrayGen.apply(Random seed) |
static fun.gen.Gen<JsArray> |
JsArrayGen.arbitrary(fun.gen.Gen<? extends JsValue> gen,
int minSize,
int maxSize)
Returns an array generator.
|
static fun.gen.Gen<JsArray> |
JsArrayGen.biased(fun.gen.Gen<? extends JsValue> gen,
int minSize,
int maxSize)
Returns a biased array generator.
|
static fun.gen.Gen<JsArray> |
JsTupleGen.of(fun.gen.Gen<? extends JsValue> gen,
fun.gen.Gen<? extends JsValue>... others)
Returns a tuple generator.
|
static fun.gen.Gen<JsArray> |
JsArrayGen.ofN(fun.gen.Gen<? extends JsValue> gen,
int size)
Returns a fixed-size array generator.
|
Modifier and Type | Method and Description |
---|---|
JsArray |
JsArraySpecParser.parse(byte[] bytes)
Parses an array of bytes representing JSON array data into a structured JSON array.
|
JsArray |
JsArraySpecParser.parse(InputStream inputstream)
Parses JSON array data from an input stream into a structured JSON array.
|
JsArray |
JsArraySpecParser.parse(String str)
Parses a JSON array string into a structured JSON array.
|
JsArray |
JsIO.parseToJsArray(byte[] bytes)
Parses the given array of bytes into an immutable and persistent JSON array.
|
Modifier and Type | Method and Description |
---|---|
static JsArraySpec |
JsSpecs.arrayOfBigIntSuchThat(Predicate<JsArray> predicate)
Returns a specification for a non-nullable array of integral numbers, where each element of the array satisfies
the given predicate.
|
static JsArraySpec |
JsSpecs.arrayOfBoolSuchThat(Predicate<JsArray> predicate)
Returns a specification for a non-nullable array of booleans that satisfies the given predicate.
|
static JsArraySpec |
JsSpecs.arrayOfDecSuchThat(Predicate<JsArray> predicate)
Returns a specification for a non-nullable array of decimal numbers, where each element of the array satisfies
the given predicate.
|
static JsArraySpec |
JsSpecs.arrayOfIntSuchThat(Predicate<JsArray> predicate)
Returns a specification for a non-nullable array of integer numbers, where each element of the array satisfies
the given predicate.
|
static JsArraySpec |
JsSpecs.arrayOfLongSuchThat(Predicate<JsArray> predicate)
Returns a specification for a non-nullable array of long numbers that satisfies the given predicate.
|
static JsArraySpec |
JsSpecs.arrayOfNumberSuchThat(Predicate<JsArray> predicate)
Returns a specification for a non-nullable array of numbers, where each element of the array satisfies
the given predicate.
|
static JsArraySpec |
JsSpecs.arrayOfObjSuchThat(Predicate<JsArray> predicate)
Returns a specification for a non-nullable array of objects that satisfies the given predicate.
|
static JsArraySpec |
JsSpecs.arrayOfStrSuchThat(Predicate<JsArray> predicate)
Returns a specification for a non-nullable array of strings, where each element of the array satisfies the given predicate.
|
static JsArraySpec |
JsSpecs.arraySuchThat(Predicate<JsArray> predicate)
Returns a specification for a non-nullable array that satisfies the given predicate.
|
Copyright © 2023. All rights reserved.