public final class CollectionFactory extends Object
Modifier and Type | Method and Description |
---|---|
static void |
clearProtection() |
static <T> List<T> |
getList(Class<T> type) |
static <T> List<T> |
getProtectedList(List<T> list)
Call this to obtain a list to return from a public API where the caller is not supposed to modify the
list.
|
static <K,V> Map<K,V> |
getProtectedMap(Map<K,V> map)
Call this to obtain a map to return from a public API where the caller is not supposed to modify the
map.
|
static <T> Set<T> |
getSet(Class<T> type) |
static void |
setProtected(boolean b)
Turns on or off protection of collections for this thread.
|
static void |
withSchemaModifiable(Runnable action) |
public static void setProtected(boolean b)
b
- public static void clearProtection()
public static <T> List<T> getProtectedList(List<T> list)
T
- Generic parameter type of the list.list
- the list.public static <K,V> Map<K,V> getProtectedMap(Map<K,V> map)
K
- key typeV
- value typemap
- the map.public static void withSchemaModifiable(Runnable action)
Copyright © 2004–2017 The Apache Software Foundation. All rights reserved.