org.jboss.msc.value
Class ConstructedValue<T>
java.lang.Object
org.jboss.msc.value.ConstructedValue<T>
- Type Parameters:
T
- the value type
- All Implemented Interfaces:
- Value<T>
public final class ConstructedValue<T>
- extends Object
- implements Value<T>
A value which is created on demand from a constructor. Each call to getValue()
will create a new instance,
so if the same instance should be returned, this should be used in conjunction with CachedValue
.
- Author:
- David M. Lloyd
Method Summary |
T |
getValue()
Get the actual value. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ConstructedValue
public ConstructedValue(Constructor<T> constructor,
List<? extends Value<?>> parameters)
- Construct a new instance.
- Parameters:
constructor
- the constructor to useparameters
- the parameters to pass to the constructor
getValue
public T getValue()
throws IllegalStateException
- Get the actual value.
- Specified by:
getValue
in interface Value<T>
- Returns:
- the actual value
- Throws:
IllegalStateException
- if the value is time-sensitive and the current state does not allow retrieval.
Copyright © 2011 JBoss, a division of Red Hat, Inc.