- All Superinterfaces:
Hson.Value<List<Hson.Value<?>>>
- Enclosing class:
Hson
A representation of HSON array.
HSON array is an array of values (of any type).
-
Method Summary
Modifier and TypeMethodDescriptionstatic Hson.Array
create()
Create an empty JArray.static Hson.Array
create
(double... values) Create a new array of Numbers from double values.static Hson.Array
create
(float... values) Create a new array of Numbers from float values.static Hson.Array
create
(int... values) Create a new array of Numbers from int values.static Hson.Array
create
(long... values) Create a new array of Numbers from long values.static Hson.Array
create
(List<? extends Hson.Value<?>> values) Create a new array of HSON values.static Hson.Array
createBooleans
(List<Boolean> booleans) Create a new array of booleans.static Hson.Array
createNumbers
(List<BigDecimal> numbers) Create a new array of Numbers.static Hson.Array
createStrings
(List<String> strings) Create a new array of Strings.Assume this is an array of booleans, and return the list.Assume this is an array of numbers, and return the list.Assume this is an array of strings, and return the list.Assume this is an array of structs, and return the list.
-
Method Details
-
create
Create an empty JArray.- Returns:
- empty array
-
create
Create a new array of HSON values.- Parameters:
values
- list of values- Returns:
- a new array
-
createStrings
Create a new array of Strings.- Parameters:
strings
- String list- Returns:
- a new string array
-
createNumbers
Create a new array of Numbers.- Parameters:
numbers
-BigDecimal
list- Returns:
- a new number array
-
createBooleans
Create a new array of booleans.- Parameters:
booleans
- boolean list- Returns:
- a new boolean array
-
create
Create a new array of Numbers from long values.- Parameters:
values
- long numbers- Returns:
- a new number array
-
create
Create a new array of Numbers from int values.- Parameters:
values
- int numbers- Returns:
- a new number array
-
create
Create a new array of Numbers from double values.- Parameters:
values
- double numbers- Returns:
- a new number array
-
create
Create a new array of Numbers from float values.- Parameters:
values
- float numbers- Returns:
- a new number array
-
getStrings
Assume this is an array of strings, and return the list.- Returns:
- all string values of this array, except for nulls
- Throws:
HsonException
- in case not all elements of this array are strings (or nulls)
-
getBooleans
Assume this is an array of booleans, and return the list.- Returns:
- all boolean values of this array, except for nulls
- Throws:
HsonException
- in case not all elements of this array are booleans (or nulls)
-
getNumbers
List<BigDecimal> getNumbers()Assume this is an array of numbers, and return the list.- Returns:
- all big decimal values of this array, except for nulls
- Throws:
HsonException
- in case not all elements of this array are numbers (or nulls)
-
getStructs
List<Hson.Struct> getStructs()Assume this is an array of structs, and return the list.- Returns:
- all struct values of this array, except for nulls
- Throws:
HsonException
- in case not all elements of this array are structs (or nulls)
-