{title:'Arrays'}

The asStringArray() method allows you to retrieve comma-delimited lists of values:

| key1 = foo, bar, baz

| String[] key1 = config.get("key1").asStringArray().orElse(null);

String arrays can also be represented in JSON when the registered parser is a JSON parser:

| key1 = ['foo','bar','baz']

| String[] key1 = config.get("key1").asStringArray().orElse(null);

Primitive arrays can also be retrieved using the as() and to() methods:

| key1 = [1,2,3]

| int[] key1 = config.get("key1").as(int[].class).orElse(null);

Arrays of POJOs can also be retrieved using the methods as well:

| addresses = | [ | { | street: '123 Main Street', | city: 'Anywhere', | state: 'NY', | zip: 12345 | }, | { | street: '456 Main Street', | city: 'Anywhere', | state: 'NY', | zip: 12345 | } | ]

| Address[] addresses = config.get("addresses").as(Address[].class).orElse(null);