Class RuntimeCoercions

java.lang.Object
io.github.protasm.jvmud.compiler.runtime.RuntimeCoercions

public final class RuntimeCoercions extends Object
Runtime coercion helpers for LPC compatibility values.
  • Method Details

    • zeroToNullReference

      public static Object zeroToNullReference(Object value)
    • toStringValue

      public static String toStringValue(Object value)
      Coerces a dynamically typed LPC value into an explicit string context.

      Classic LPC mudlibs frequently use mixed property bags and the numeric false sentinel 0. In dynamic JVMud string contexts, that sentinel remains a false reference value so checks like saved == 0 keep working. Other dynamic values are rendered textually instead of relying on a raw Java String cast.

    • toArrayValue

      public static Object toArrayValue(Object value)
      Coerces a dynamically typed LPC value into an explicit array context.

      Some legacy mudlibs use ([]) as a falsey empty collection placeholder before passing it into array-typed helpers that only check sizeof(). LDMud tolerates that at runtime; JVMud preserves the practical behavior only for the empty-mapping case and leaves non-empty mappings incompatible with arrays.

    • incrementNumber

      public static Object incrementNumber(Object value, int delta)
      Returns an incremented numeric value for dynamically typed mutation expressions.