java.lang.Object
technology.sola.script.interpreter.ValueUtils

public class ValueUtils extends Object
ValueUtils contains various utility methods for sola-script values.
  • Method Details

    • stringify

      public static @NonNull String stringify(@Nullable Object value)
      Method to make a sola-script value into a string.
      • null -> "null"
      • true -> "true"
      • 12.0 -> 12
      • 12.35 -> 12.35
      • "test" -> "test"
      Parameters:
      value - the value to stringify
      Returns:
      the stringified value
    • isTruthy

      public static boolean isTruthy(@Nullable Object value)
      Checks to see if a value is considered "truthy" or not. A value is considered truthy if it is not null and not a boolean false.
      Parameters:
      value - the value to check if truthy
      Returns:
      true if truthy