JBoss Modular Service Kernel API 1.0.0.CR2

org.jboss.msc.value
Class Values

java.lang.Object
  extended by org.jboss.msc.value.Values

public final class Values
extends Object

Value utility methods.

Author:
David M. Lloyd

Field Summary
static List<Value<?>> EMPTY_LIST
          The empty value list.
static List<? extends Value<Class<?>>> EMPTY_TYPE_LIST
          The empty value type list.
 
Method Summary
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> List<Value<? extends T>>
emptyList()
          The empty value list.
static
<T> Value<List<T>>
emptyListValue()
          A value which yields the empty list.
static Object[] getValues(Iterable<? extends Value<?>> i)
          Get an object array from the result of an iterable series of values.
static
<T> T[]
getValues(Iterable<? extends Value<? extends T>> i, Class<T> clazz)
          Get a typed object array from the result of an iterable series of values.
static
<T> T[]
getValues(Iterable<? extends Value<? extends T>> i, T[] array)
          Get a typed object array from the result of an iterable series of values.
static
<T> Value<T>
immediateValue(T value)
          Get an immediate value.
static
<T> List<Value<? extends T>>
immediateValues(List<T> values)
           
static
<T> List<Value<? extends T>>
immediateValues(T... values)
           
static ThreadLocalValue<Object> injectedValue()
          The special value representing the value of an injection operation.
static
<T> Value<T>
nullValue()
          Get the null value.
static ThreadLocalValue<Object> thisValue()
          The special value representing this (the object being invoked upon).
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

EMPTY_LIST

public static final List<Value<?>> EMPTY_LIST
The empty value list.


EMPTY_TYPE_LIST

public static final List<? extends Value<Class<?>>> EMPTY_TYPE_LIST
The empty value type list.

Method Detail

getValues

public static Object[] getValues(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(Iterable<? extends Value<? extends T>> i,
                                Class<T> clazz)
Get a typed object array from the result of an iterable series of values.

Parameters:
i - the iterable series
clazz - the resultant array type
Returns:
the values array

getValues

public static <T> T[] getValues(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 series
array - 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> 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<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> List<Value<? extends T>> immediateValues(List<T> values)

immediateValues

public static <T> 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<Object> thisValue()
The special value representing this (the object being invoked upon).

Returns:
the value for this

injectedValue

public static ThreadLocalValue<Object> injectedValue()
The special value representing the value of an injection operation.

Returns:
the target value

JBoss Modular Service Kernel API 1.0.0.CR2

Copyright © 2011 JBoss, a division of Red Hat, Inc.