All Known Implementing Classes:
ValueBase, 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 Details

    • getType

      IValueType getType()
      Returns:
      The type of this variable.
    • cast

      <V extends IValue> V cast(IValueType<V> valueType) throws IValueCastRegistry.ValueCastException
      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

      <V extends IValue> boolean canCast(IValueType<V> valueType)
      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.