All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.deephacks.tools4j.config.internal.core.runtime.typesafe.ConfigList Maven / Gradle / Ivy

There is a newer version: 0.15.0
Show newest version
/**
 *   Copyright (C) 2011-2012 Typesafe Inc. 
 */
package org.deephacks.tools4j.config.internal.core.runtime.typesafe;

import java.util.List;

/**
 * Subtype of {@link ConfigValue} representing a list value, as in JSON's
 * {@code [1,2,3]} syntax.
 *
 * 

* {@code ConfigList} implements {@code java.util.List} so you can * use it like a regular Java list. Or call {@link #unwrapped()} to unwrap the * list elements into plain Java values. * *

* Like list {@link ConfigValue} subtypes, {@code ConfigList} is immutable. This * makes it threadsafe and you never have to create "defensive copies." The * mutator methods from {@link java.util.List} list throw * {@link java.lang.UnsupportedOperationException}. * *

* The {@link ConfigValue#valueType} method on a list returns * {@link ConfigValueType#LIST}. * *

* Do not implement {@code ConfigList}; it should only be implemented * by the typesafe library. Arbitrary implementations will not work because the * library internals assume a specific concrete implementation. Also, this * interface is likely to grow new methods over time, so third-party * implementations will break. * */ public interface ConfigList extends List, ConfigValue { /** * Recursively unwraps the list, returning a list of plain Java values such * as Integer or String or whatever is in the list. */ @Override List unwrapped(); }