Interface IValue
- All Known Implementing Classes:
DummyValueType.DummyValue, ValueBase, ValueEntityMock, ValueObjectTypeBlock.ValueBlock, ValueObjectTypeEntity.ValueEntity, ValueObjectTypeFluidStack.ValueFluidStack, ValueObjectTypeIngredients.ValueIngredients, ValueObjectTypeItemStack.ValueItemStack, ValueObjectTypeRecipe.ValueRecipe, ValueOptionalBase, ValueTypeBoolean.ValueBoolean, ValueTypeDouble.ValueDouble, ValueTypeInteger.ValueInteger, ValueTypeList.ValueList, ValueTypeLong.ValueLong, ValueTypeNbt.ValueNbt, ValueTypeOperator.ValueOperator, ValueTypeString.ValueString
public interface IValue
An immutable value.
-
Method Summary
Modifier and TypeMethodDescription<V extends IValue>
booleancanCast(IValueType<V> valueType) Safely downcast this value.<V extends IValue>
Vcast(IValueType<V> valueType) Safely downcast this value.getType()
-
Method Details
-
getType
IValueType getType()- Returns:
- The type of this variable.
-
cast
Safely downcast this value.- Type Parameters:
V- The actual value type.- Parameters:
valueType- The type of value to cast to.- Returns:
- The downcasted value.
- Throws:
IValueCastRegistry.ValueCastException- If this value could not be cast to the given type.
-
canCast
Safely downcast this value.- Type Parameters:
V- The actual value type.- Parameters:
valueType- The type of value to cast to.- Returns:
- If this value can be casted to the target type.
-