E- The type of element wrapped by this value
public interface BaseValue<E>
BaseValueis a "wrapper" around an actual value from a
ValueContainer. The actual value may come from various sources of the
ValueContainer, but usually it's a generic dynamic system for being able to fetch values from object fields without having to know the type of
ValueContainer, the getters and setters for that particular value. The driving force behind this is that instead of having a traditional hierarchical structure of data that is possible to be retrieved from an
Living, etc., all that is required is
where the container is simply a
container.supports(Keys.HEALTH) ? container.get(Keys.HEALTH).get() : 0
ValueContainer, nothing more, nothing less.
The advantage of this is that now, these various known and unknown
Values can be retrieved by simple java generics:
ValueContainer.getValue(Key). While having a
something so primitive as the current health of a
the power is wielded when a
Value can be offered up to multiple
ValueContainers without worrying about whether it's supported or not,
or getting the right cast information.
|Modifier and Type||Method and Description|
Checks that the underlying value exists (or "set").
Gets the held value.
Gets the default value.
Gets the direct value.
Gets the key for this
exists()returns false, the
getDefault()value is returned.
get()would return the