Class MCValueError

java.lang.Object
de.monticore.values.MCValueError
All Implemented Interfaces:
MCValue

public class MCValueError extends Object implements MCValue
  • Constructor Details

    • MCValueError

      public MCValueError(String message)
    • MCValueError

      public MCValueError(Throwable throwable)
  • Method Details

    • isError

      public boolean isError()
      Specified by:
      isError in interface MCValue
    • asError

      public String asError()
      Specified by:
      asError in interface MCValue
    • asNativeObject

      public Throwable asNativeObject()
      Description copied from interface: MCValue
      Used to pass the value to native Java classes and similar, e.g., collections.

      Note: not all values can have a native representation, as such, their native version is the MIValue itself.

      Specified by:
      asNativeObject in interface MCValue
      Returns:
      The value as a Java native Object.
    • asString

      public String asString()
      Specified by:
      asString in interface MCValue
    • checkEqualityOperator

      public boolean checkEqualityOperator(MCValue other)
      Description copied from interface: MCValue
      basically implements ==
      Specified by:
      checkEqualityOperator in interface MCValue
      Parameters:
      other - the value to check against this
      Returns:
      whether they are considered equal
    • printType

      public String printType()
      Description copied from interface: MCValue
      Print the type of the MIValue in human-readable form
      Specified by:
      printType in interface MCValue
    • printValue

      public String printValue()
      Description copied from interface: MCValue
      Print the value in human-readable form
      Specified by:
      printValue in interface MCValue
    • getMessage

      protected String getMessage()