Uses of Interface
jsonvalues.JsValue
-
Packages that use JsValue Package Description com.dslplatform.json.parsers jsonvalues json-values is a one-package and zero-dependency library to work with jsons in a declarative and functional way.jsonvalues.gen jsonvalues.spec -
-
Uses of JsValue in com.dslplatform.json.parsers
Methods in com.dslplatform.json.parsers that return JsValue Modifier and Type Method Description JsValue
JsArraySpecParser. nullOrArray(com.dslplatform.json.JsonReader<?> reader)
JsValue
JsSpecParser. parse(com.dslplatform.json.JsonReader<?> reader)
Method parameters in com.dslplatform.json.parsers with type arguments of type JsValue Modifier and Type Method Description JsSpecParser
JsSpecParsers. ofArrayOfValueEachSuchThat(java.util.function.Function<JsValue,java.util.Optional<Error>> p, boolean nullable)
JsSpecParser
JsSpecParsers. ofValueSuchThat(java.util.function.Function<JsValue,java.util.Optional<Error>> predicate)
-
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
JsBinary
Represents an array of bytes.class
JsBool
Represents an immutable json boolean.class
JsDouble
Represents an immutable json number of type double.class
JsInstant
Represents an immutable instant.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
JsNumber
Represents an immutable json number.class
JsObj
Represents a json object, which is an unordered set of name/element pairs.class
JsPrimitive
class
JsStr
Represents an immutable json string.Fields in jsonvalues declared as JsValue Modifier and Type Field Description JsValue
JsPair. value
the json value.Fields in jsonvalues with type parameters of type JsValue Modifier and Type Field Description static Prism<JsValue,JsArray>
JsArray. prism
prism between the sum type JsValue and JsArraystatic Prism<JsValue,java.math.BigDecimal>
JsBigDec. prism
prism between the sum type JsValue and JsBigDecstatic Prism<JsValue,java.math.BigInteger>
JsBigInt. prism
static Prism<JsValue,byte[]>
JsBinary. prism
prism between the sum type JsValue and JsBinarystatic Prism<JsValue,java.lang.Boolean>
JsBool. prism
prism between the sum type JsValue and JsBoolstatic Prism<JsValue,java.lang.Double>
JsDouble. prism
prism between the sum type JsValue and JsDoublestatic Prism<JsValue,java.time.Instant>
JsInstant. prism
prism between the sum type JsValue and JsInstantstatic Prism<JsValue,java.lang.Integer>
JsInt. prism
prism between the sum type JsValue and JsIntstatic Prism<JsValue,java.lang.Long>
JsLong. prism
prism between the sum type JsValue and JsLongstatic Prism<JsValue,JsObj>
JsObj. prism
prism between the sum type JsValue and JsObjstatic Prism<JsValue,java.lang.String>
JsStr. prism
prism between the sum type JsValue and JsStrstatic Lens<JsPair,JsValue>
JsPair. valueLens
lens that focuses on the value of a pairMethods in jsonvalues that return JsValue Modifier and Type Method Description JsValue
JsArray. get(int i)
returns the element located at the specified index or JsNothing if it doesn't exist.JsValue
JsArray. get(JsPath path)
JsValue
JsObj. get(java.lang.String key)
JsValue
JsObj. get(JsPath path)
JsValue
Json. get(JsPath path)
Returns the element located at the given path orJsNothing
if it doesn't exist.JsValue
JsArray. head()
Returns the first element of this array.default JsValue
JsValue. ifNothing(JsValue value)
returns the specified default value if nothing or the same this objectdefault JsValue
JsValue. ifNull(JsValue value)
returns the specified default value if null or the same this objectJsValue
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 io.vavr.Tuple2<java.lang.String,JsValue>
JsObj. head()
Returns a pair with an arbitrary key of this object and its associated element.java.util.Iterator<JsValue>
JsArray. iterator()
java.util.Iterator<io.vavr.Tuple2<java.lang.String,JsValue>>
JsObj. iterator()
java.util.stream.Stream<JsValue>
JsArray. streamValues()
java.util.stream.Stream<JsValue>
JsObj. streamValues()
java.util.stream.Stream<JsValue>
Json. streamValues()
Lens<JsArray,JsValue>
JsOptics.JsArrayLenses. value(int index)
lens that focus on the value located at an index in an arrayLens<JsArray,JsValue>
JsOptics.JsArrayLenses. value(JsPath path)
lens that focus on the value located at a path in an arrayLens<JsObj,JsValue>
JsOptics.JsObjLenses. value(java.lang.String key)
lens that focus on a value located at a key in an object.Lens<JsObj,JsValue>
JsOptics.JsObjLenses. value(JsPath path)
lens that focus on a value located at a path in an object.Methods in jsonvalues with parameters of type JsValue Modifier and Type Method Description JsArray
JsArray. append(JsValue e, JsValue... others)
Adds one or more elements, starting from the first, to the back of this array.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 JsValue
JsValue. ifNothing(JsValue value)
returns the specified default value if nothing or the same this objectdefault JsValue
JsValue. ifNull(JsValue value)
returns the specified default value if null or the same this objectdefault 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(java.lang.String key, JsValue el)
Returns a one-element immutable object.static JsObj
JsObj. of(java.lang.String key1, JsValue el1, java.lang.String key2, JsValue el2)
Returns a two-element immutable object.static JsObj
JsObj. of(java.lang.String key1, JsValue el1, java.lang.String key2, JsValue el2, java.lang.String key3, JsValue el3)
Returns a three-element immutable object.static JsObj
JsObj. of(java.lang.String key1, JsValue el1, java.lang.String key2, JsValue el2, java.lang.String key3, JsValue el3, java.lang.String key4, JsValue el4)
Returns a four-element immutable object.static JsObj
JsObj. of(java.lang.String key1, JsValue el1, java.lang.String key2, JsValue el2, java.lang.String key3, JsValue el3, java.lang.String key4, JsValue el4, java.lang.String key5, JsValue el5)
Returns a five-element immutable object.static JsObj
JsObj. of(java.lang.String key1, JsValue el1, java.lang.String key2, JsValue el2, java.lang.String key3, JsValue el3, java.lang.String key4, JsValue el4, java.lang.String key5, JsValue el5, java.lang.String key6, JsValue el6)
Returns a six-element immutable object.static JsObj
JsObj. of(java.lang.String key1, JsValue el1, java.lang.String key2, JsValue el2, java.lang.String key3, JsValue el3, java.lang.String key4, JsValue el4, java.lang.String key5, JsValue el5, java.lang.String key6, JsValue el6, java.lang.String key7, JsValue el7)
Returns a six-element immutable object.static JsObj
JsObj. of(java.lang.String key1, JsValue el1, java.lang.String key2, JsValue el2, java.lang.String key3, JsValue el3, java.lang.String key4, JsValue el4, java.lang.String key5, JsValue el5, java.lang.String key6, JsValue el6, java.lang.String key7, JsValue el7, java.lang.String key8, JsValue el8)
Returns a six-element immutable object.static JsObj
JsObj. of(java.lang.String key1, JsValue el1, java.lang.String key2, JsValue el2, java.lang.String key3, JsValue el3, java.lang.String key4, JsValue el4, java.lang.String key5, JsValue el5, java.lang.String key6, JsValue el6, java.lang.String key7, JsValue el7, java.lang.String key8, JsValue el8, java.lang.String key9, JsValue el9)
Returns a six-element immutable object.static JsObj
JsObj. of(java.lang.String key1, JsValue el1, java.lang.String key2, JsValue el2, java.lang.String key3, JsValue el3, java.lang.String key4, JsValue el4, java.lang.String key5, JsValue el5, java.lang.String key6, JsValue el6, java.lang.String key7, JsValue el7, java.lang.String key8, JsValue el8, java.lang.String key9, JsValue el9, java.lang.String key10, JsValue el10)
Returns a six-element immutable object.static JsObj
JsObj. of(java.lang.String key1, JsValue el1, java.lang.String key2, JsValue el2, java.lang.String key3, JsValue el3, java.lang.String key4, JsValue el4, java.lang.String key5, JsValue el5, java.lang.String key6, JsValue el6, java.lang.String key7, JsValue el7, java.lang.String key8, JsValue el8, java.lang.String key9, JsValue el9, java.lang.String key10, JsValue el10, java.lang.String key11, JsValue el11)
Returns a six-element immutable object.static JsObj
JsObj. of(java.lang.String key1, JsValue el1, java.lang.String key2, JsValue el2, java.lang.String key3, JsValue el3, java.lang.String key4, JsValue el4, java.lang.String key5, JsValue el5, java.lang.String key6, JsValue el6, java.lang.String key7, JsValue el7, java.lang.String key8, JsValue el8, java.lang.String key9, JsValue el9, java.lang.String key10, JsValue el10, java.lang.String key11, JsValue el11, java.lang.String key12, JsValue el12)
Returns a six-element immutable object.static JsObj
JsObj. of(java.lang.String key1, JsValue el1, java.lang.String key2, JsValue el2, java.lang.String key3, JsValue el3, java.lang.String key4, JsValue el4, java.lang.String key5, JsValue el5, java.lang.String key6, JsValue el6, java.lang.String key7, JsValue el7, java.lang.String key8, JsValue el8, java.lang.String key9, JsValue el9, java.lang.String key10, JsValue el10, java.lang.String key11, JsValue el11, java.lang.String key12, JsValue el12, java.lang.String key13, JsValue el13)
Returns a six-element immutable object.static JsObj
JsObj. of(java.lang.String key1, JsValue el1, java.lang.String key2, JsValue el2, java.lang.String key3, JsValue el3, java.lang.String key4, JsValue el4, java.lang.String key5, JsValue el5, java.lang.String key6, JsValue el6, java.lang.String key7, JsValue el7, java.lang.String key8, JsValue el8, java.lang.String key9, JsValue el9, java.lang.String key10, JsValue el10, java.lang.String key11, JsValue el11, java.lang.String key12, JsValue el12, java.lang.String key13, JsValue el13, java.lang.String key14, JsValue el14)
Returns a six-element immutable object.static JsObj
JsObj. of(java.lang.String key1, JsValue el1, java.lang.String key2, JsValue el2, java.lang.String key3, JsValue el3, java.lang.String key4, JsValue el4, java.lang.String key5, JsValue el5, java.lang.String key6, JsValue el6, java.lang.String key7, JsValue el7, java.lang.String key8, JsValue el8, java.lang.String key9, JsValue el9, java.lang.String key10, JsValue el10, java.lang.String key11, JsValue el11, java.lang.String key12, JsValue el12, java.lang.String key13, JsValue el13, java.lang.String key14, JsValue el14, java.lang.String key15, JsValue el15)
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(JsValue e, JsValue... others)
Adds one or more elements, 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)
JsArray
JsArray. set(JsPath path, JsValue element)
JsArray
JsArray. set(JsPath path, JsValue value, JsValue padElement)
JsObj
JsObj. set(java.lang.String key, JsValue value)
Inserts the element at the key in this json, replacing any existing element.JsObj
JsObj. set(JsPath path, JsValue element)
JsObj
JsObj. set(JsPath path, JsValue value, JsValue padElement)
default T
Json. set(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.T
Json. set(JsPath path, JsValue element, JsValue padElement)
Inserts the element at the path in this json, replacing any existing element and filling with padElement 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 JsArray
JsArray. filterAllKeys(java.util.function.BiPredicate<? super JsPath,? super JsValue> filter)
JsObj
JsObj. filterAllKeys(java.util.function.BiPredicate<? super JsPath,? super JsValue> filter)
T
Json. filterAllKeys(java.util.function.BiPredicate<? super JsPath,? super JsValue> filter)
Filters all the keys of this json, removing those that don't ifPredicateElse the predicate.JsArray
JsArray. filterKeys(java.util.function.BiPredicate<? super java.lang.String,? super JsValue> filter)
JsObj
JsObj. filterKeys(java.util.function.BiPredicate<? super java.lang.String,? super JsValue> filter)
JsArray
JsArray. mapAllKeys(java.util.function.BiFunction<? super JsPath,? super JsValue,java.lang.String> fn)
JsObj
JsObj. mapAllKeys(java.util.function.BiFunction<? super JsPath,? super JsValue,java.lang.String> fn)
T
Json. mapAllKeys(java.util.function.BiFunction<? super JsPath,? super JsValue,java.lang.String> fn)
Maps all the keys of this json.JsArray
JsArray. mapAllObjs(java.util.function.BiFunction<? super JsPath,? super JsObj,JsValue> fn)
JsArray
JsArray. mapAllObjs(java.util.function.Function<? super JsObj,JsValue> fn)
JsObj
JsObj. mapAllObjs(java.util.function.BiFunction<? super JsPath,? super JsObj,JsValue> fn)
JsObj
JsObj. mapAllObjs(java.util.function.Function<? super JsObj,JsValue> fn)
T
Json. mapAllObjs(java.util.function.BiFunction<? super JsPath,? super JsObj,JsValue> fn)
Maps all the jsons of this json.T
Json. mapAllObjs(java.util.function.Function<? super JsObj,JsValue> fn)
Maps all the jsons of this json.JsArray
JsArray. mapAllValues(java.util.function.BiFunction<? super JsPath,? super JsPrimitive,? extends JsValue> fn)
JsArray
JsArray. mapAllValues(java.util.function.Function<? super JsPrimitive,? extends JsValue> fn)
JsObj
JsObj. mapAllValues(java.util.function.BiFunction<? super JsPath,? super JsPrimitive,? extends JsValue> fn)
JsObj
JsObj. mapAllValues(java.util.function.Function<? super JsPrimitive,? extends JsValue> fn)
T
Json. mapAllValues(java.util.function.BiFunction<? super JsPath,? super JsPrimitive,? extends JsValue> fn)
Maps all the values of this json.T
Json. mapAllValues(java.util.function.Function<? super JsPrimitive,? extends JsValue> fn)
Maps all the values of this json.JsArray
JsArray. mapKeys(java.util.function.BiFunction<? super java.lang.String,? super JsValue,java.lang.String> fn)
JsObj
JsObj. mapKeys(java.util.function.BiFunction<? super java.lang.String,? super JsValue,java.lang.String> fn)
JsArray
JsArray. mapObjs(java.util.function.BiFunction<? super java.lang.Integer,? super JsObj,JsValue> fn)
JsArray
JsArray. mapObjs(java.util.function.Function<? super JsObj,JsValue> fn)
JsObj
JsObj. mapObjs(java.util.function.BiFunction<? super java.lang.String,? super JsObj,JsValue> fn)
JsObj
JsObj. mapObjs(java.util.function.Function<? super JsObj,JsValue> fn)
T
Json. mapObjs(java.util.function.Function<? super JsObj,JsValue> fn)
Maps the jsons in the first level of this json.JsArray
JsArray. mapValues(java.util.function.BiFunction<? super java.lang.Integer,? super JsPrimitive,? extends JsValue> fn)
JsArray
JsArray. mapValues(java.util.function.Function<? super JsPrimitive,? extends JsValue> fn)
JsObj
JsObj. mapValues(java.util.function.BiFunction<? super java.lang.String,? super JsPrimitive,? extends JsValue> fn)
JsObj
JsObj. mapValues(java.util.function.Function<? super JsPrimitive,? extends JsValue> fn)
T
Json. mapValues(java.util.function.Function<? super JsPrimitive,? extends JsValue> fn)
Maps the values in the first level of this json.static JsArray
JsArray. ofIterable(java.lang.Iterable<? extends JsValue> iterable)
returns an immutable json array from an iterable of json elementsstatic JsObj
JsObj. ofIterable(java.lang.Iterable<java.util.Map.Entry<java.lang.String,JsValue>> xs)
-
Uses of JsValue in jsonvalues.gen
Classes in jsonvalues.gen with type parameters of type JsValue Modifier and Type Interface Description interface
JsGen<R extends JsValue>
Methods in jsonvalues.gen with type parameters of type JsValue Modifier and Type Method Description default <T extends JsValue>
JsGen<T>JsGen. flatMap(java.util.function.Function<R,JsGen<T>> f)
Creates a new generator that passes the result of this generator into the given function `f`.default <T extends JsValue>
JsGen<T>JsGen. map(java.util.function.Function<R,T> f)
Returns this generator but with the values transformed by the given map functionstatic <O extends JsValue>
JsGen<O>JsGens. oneOf(java.util.List<O> list)
Creates a generator that randomly chooses a value from the given liststatic <O extends JsValue>
voidTestProperty. test(JsGen<O> gen, java.util.function.Predicate<O> condition, int times, java.util.function.Consumer<O> errorConsumer)
static <O extends JsValue>
voidTestProperty. test(JsGen<O> gen, java.util.function.Predicate<O> condition, int times, java.util.function.Consumer<O> errorConsumer, java.util.Random random)
static <O extends JsValue>
voidTestProperty. test(JsGen<O> gen, java.util.function.Predicate<O> condition, java.util.function.Consumer<O> errorConsumer)
static <O extends JsValue>
voidTestProperty. test(JsGen<O> gen, java.util.function.Predicate<O> condition, java.util.function.Consumer<O> errorConsumer, java.util.Random random)
Methods in jsonvalues.gen that return types with arguments of type JsValue Modifier and Type Method Description static JsGen<JsValue>
JsGens. cons(JsValue value)
generates a constantstatic JsGen<JsValue>
JsGens. oneOf(JsValue a, JsValue... others)
Creates a generator that randomly chooses a value from the given as parametersstatic JsGen<JsValue>
JsGens. single(JsValue value)
lift a constant value up into a generatorMethods in jsonvalues.gen with parameters of type JsValue Modifier and Type Method Description static JsGen<JsValue>
JsGens. cons(JsValue value)
generates a constantstatic JsGen<JsValue>
JsGens. oneOf(JsValue a, JsValue... others)
Creates a generator that randomly chooses a value from the given as parametersstatic JsGen<JsValue>
JsGens. single(JsValue value)
lift a constant value up into a generator -
Uses of JsValue in jsonvalues.spec
Fields in jsonvalues.spec declared as JsValue Modifier and Type Field Description JsValue
Error. value
Methods in jsonvalues.spec with type parameters of type JsValue Modifier and Type Method Description static <O extends JsValue>
JsSpecJsSpecs. oneOf(java.util.List<O> cons)
Methods in jsonvalues.spec with parameters of type JsValue Modifier and Type Method Description static JsSpec
JsSpecs. cons(JsValue value)
a required and non nullable spec that specifies a constantjava.util.Set<JsErrorPair>
JsArrayOfJsObjSpec. test(JsPath parentPath, JsValue value)
java.util.Set<JsErrorPair>
JsObjSpec. test(JsPath parentPath, JsValue value)
java.util.Set<JsErrorPair>
JsSpec. test(JsPath parentPath, JsValue value)
verify if the given value satisfy this spec.java.util.Set<JsErrorPair>
JsTupleSpec. test(JsPath parentPath, JsValue value)
Method parameters in jsonvalues.spec with type arguments of type JsValue Modifier and Type Method Description static JsSpec
JsSpecs. any(java.util.function.Predicate<JsValue> predicate)
returns a spec that conforms any value that is evaluated to true on the predicate.static JsArraySpec
JsSpecs. array(java.util.function.Predicate<JsValue> predicate)
non-nullable array, where each element of the array satisfies the given predicateConstructors in jsonvalues.spec with parameters of type JsValue Constructor Description Error(JsValue value, ERROR_CODE code)
-