Package org.jboss.msc.value
Class Values
- java.lang.Object
-
- org.jboss.msc.value.Values
-
public final class Values extends java.lang.ObjectValue utility methods.
-
-
Field Summary
Fields Modifier and Type Field Description static java.util.List<Value<?>>EMPTY_LISTThe empty value list.private static ValueEMPTY_LIST_VALUEstatic java.util.List<? extends Value<java.lang.Class<?>>>EMPTY_TYPE_LISTThe empty value type list.private static ThreadLocalValue<java.lang.Object>INJECTEDprivate static java.lang.Object[]NONEprivate static ValueNULLprivate static ThreadLocalValue<java.lang.Object>THIS
-
Constructor Summary
Constructors Modifier Constructor Description privateValues()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description private static <T> T[]arrayOf(java.lang.Class<T> clazz, int len)static <T> Value<T>asSuperclass(Value<? extends T> value)Safely re-cast a value as its superclass.static <T> Value<T>cached(Value<T> value)Get a cached value for some opaque value.static <T> java.util.List<Value<? extends T>>emptyList()The empty value list.static <T> Value<java.util.List<T>>emptyListValue()A value which yields the empty list.static java.lang.Object[]getValues(java.lang.Iterable<? extends Value<?>> i)Get an object array from the result of an iterable series of values.static <T> T[]getValues(java.lang.Iterable<? extends Value<? extends T>> i, java.lang.Class<T> clazz)Get a typed object array from the result of an iterable series of values.static <T> T[]getValues(java.lang.Iterable<? extends Value<? extends T>> i, T[] array)Get a typed object array from the result of an iterable series of values.private static java.lang.Object[]getValues(java.util.Iterator<? extends Value<?>> i, int idx)private static <T> T[]getValues(java.util.Iterator<? extends Value<? extends T>> i, java.lang.Class<T> clazz, int idx)static <T> Value<T>immediateValue(T value)Get an immediate value.static <T> java.util.List<Value<? extends T>>immediateValues(java.util.List<T> values)static <T> java.util.List<Value<? extends T>>immediateValues(T... values)static ThreadLocalValue<java.lang.Object>injectedValue()The special value representing the value of an injection operation.static <T> Value<T>nullValue()Get the null value.static ThreadLocalValue<java.lang.Object>thisValue()The special value representingthis(the object being invoked upon).
-
-
-
Field Detail
-
THIS
private static final ThreadLocalValue<java.lang.Object> THIS
-
INJECTED
private static final ThreadLocalValue<java.lang.Object> INJECTED
-
NULL
private static final Value NULL
-
NONE
private static final java.lang.Object[] NONE
-
EMPTY_LIST
public static final java.util.List<Value<?>> EMPTY_LIST
The empty value list.
-
EMPTY_TYPE_LIST
public static final java.util.List<? extends Value<java.lang.Class<?>>> EMPTY_TYPE_LIST
The empty value type list.
-
EMPTY_LIST_VALUE
private static final Value EMPTY_LIST_VALUE
-
-
Method Detail
-
getValues
private static <T> T[] getValues(java.util.Iterator<? extends Value<? extends T>> i, java.lang.Class<T> clazz, int idx)
-
arrayOf
private static <T> T[] arrayOf(java.lang.Class<T> clazz, int len)
-
getValues
private static java.lang.Object[] getValues(java.util.Iterator<? extends Value<?>> i, int idx)
-
getValues
public static java.lang.Object[] getValues(java.lang.Iterable<? extends Value<?>> i)
Get an object array from the result of an iterable series of values.- Parameters:
i- the iterable series- Returns:
- the values array
-
getValues
public static <T> T[] getValues(java.lang.Iterable<? extends Value<? extends T>> i, java.lang.Class<T> clazz)
Get a typed object array from the result of an iterable series of values.- Parameters:
i- the iterable seriesclazz- the resultant array type- Returns:
- the values array
-
getValues
public static <T> T[] getValues(java.lang.Iterable<? extends Value<? extends T>> i, T[] array)
Get a typed object array from the result of an iterable series of values.- Parameters:
i- the iterable seriesarray- the array to populate- Returns:
- the values array
-
nullValue
public static <T> Value<T> nullValue()
Get the null value.- Type Parameters:
T- the value type- Returns:
- a value which always yields
null
-
cached
public static <T> Value<T> cached(Value<T> value)
Get a cached value for some opaque value. If the value is already cached, it is returned as-is.- Type Parameters:
T- the value type- Parameters:
value- the value to wrap- Returns:
- a cached value
-
emptyList
public static <T> java.util.List<Value<? extends T>> emptyList()
The empty value list.- Type Parameters:
T- the value type- Returns:
- the empty value list
-
immediateValue
public static <T> Value<T> immediateValue(T value)
Get an immediate value.- Type Parameters:
T- the value type- Parameters:
value- the value to return- Returns:
- the immediate value
-
emptyListValue
public static <T> Value<java.util.List<T>> emptyListValue()
A value which yields the empty list.- Type Parameters:
T- the list member type- Returns:
- the empty list value
-
immediateValues
public static <T> java.util.List<Value<? extends T>> immediateValues(java.util.List<T> values)
-
immediateValues
public static <T> java.util.List<Value<? extends T>> immediateValues(T... values)
-
asSuperclass
public static <T> Value<T> asSuperclass(Value<? extends T> value)
Safely re-cast a value as its superclass.- Type Parameters:
T- the value type- Parameters:
value- the value to re-cast- Returns:
- the value
-
thisValue
public static ThreadLocalValue<java.lang.Object> thisValue()
The special value representingthis(the object being invoked upon).- Returns:
- the value for
this
-
injectedValue
public static ThreadLocalValue<java.lang.Object> injectedValue()
The special value representing the value of an injection operation.- Returns:
- the target value
-
-