public final class Jsons extends Object
| Modifier and Type | Class and Description |
|---|---|
static class |
Jsons.Arr |
static class |
Jsons.Obj |
static class |
Jsons.Prop |
static class |
Jsons.Val |
| Modifier and Type | Field and Description |
|---|---|
static Function<Jsons.Prop,Jsons.Val> |
getVal
Get the value from a property.
|
static Function<Jsons.Val,Boolean> |
notZero
Check if a value is not
ZERO_VAL. |
static Jsons.Val |
NULL
JSON null.
|
static Function<String,Jsons.Val> |
stringVal |
static Function<Jsons.Obj,String> |
toJson
toJson(org.opencastproject.util.Jsons.Obj) as a function. |
static Jsons.Arr |
ZERO_ARR
Identity for
arrays. |
static Jsons.Obj |
ZERO_OBJ
Identity for
objects. |
static Jsons.Val |
ZERO_VAL
Identity for
values. |
| Modifier and Type | Method and Description |
|---|---|
static Jsons.Arr |
append(Jsons.Arr... as)
Append a list of arrays into one.
|
static Jsons.Obj |
append(Jsons.Obj... os)
Merge a list of objects into one (last one wins).
|
static Jsons.Arr |
arr(Jsons.Val... vs)
Create an array.
|
static Jsons.Arr |
arr(List<Jsons.Val> vs)
Create an array.
|
static Jsons.Arr |
arr(Monadics.ListMonadic<Jsons.Val> vs)
Create an array.
|
static Jsons.Obj |
obj(Jsons.Prop... ps)
Create an object.
|
static Jsons.Prop |
p(String key,
Boolean value)
Create a property.
|
static Jsons.Prop |
p(String key,
Date value)
Create a property.
|
static Jsons.Prop |
p(String key,
Jsons.Val val)
Create a property.
|
static Jsons.Prop |
p(String key,
Number value)
Create a property.
|
static Jsons.Prop |
p(String key,
Option<Jsons.Val> val)
Create a property.
|
static Jsons.Prop |
p(String key,
String value)
Create a property.
|
static String |
toJson(Jsons.Arr arr) |
static String |
toJson(Jsons.Obj obj) |
static Jsons.Val |
v(Boolean v) |
static Jsons.Val |
v(Date v) |
static Jsons.Val |
v(Number v) |
static Jsons.Val |
v(String v) |
public static final Function<Jsons.Prop,Jsons.Val> getVal
public static final Function<Jsons.Obj,String> toJson
toJson(org.opencastproject.util.Jsons.Obj) as a function.public static final Jsons.Val NULL
public static Jsons.Obj obj(Jsons.Prop... ps)
public static Jsons.Arr arr(Monadics.ListMonadic<Jsons.Val> vs)
public static Jsons.Prop p(String key, Jsons.Val val)
public static Jsons.Prop p(String key, Option<Jsons.Val> val)
ZERO_VAL which erases the property.public static Jsons.Prop p(String key, Number value)
public static Jsons.Prop p(String key, String value)
public static Jsons.Prop p(String key, Boolean value)
public static Jsons.Prop p(String key, Date value)
public static Jsons.Obj append(Jsons.Obj... os)
Copyright © 2009–2020 Opencast Project. All rights reserved.