Interface ArgumentConverter


  • public interface ArgumentConverter
    Defines an interface which can be used to convert arguments to different representation forms. Internally, this is used to convert engine representations to testModel representations (which I should not have written here since engine does not know about testModel, but meh...).
    • Method Detail

      • canConvert

        boolean canConvert​(java.lang.Object argument)
        Checks whether the given argument can be converted by this ArgumentConverter. If true is returned from this method, the result returned by convert(Object) is guaranteed to "make sense". Otherwise, the result is not defined an any Exception may be thrown.
        Parameters:
        argument - the argument for which a possible conversion is checked
        Returns:
        whether the argument can be converted using convert(Object)
      • convert

        java.lang.Object convert​(java.lang.Object argument)
        Converts the given argument if canConvert(Object) returned true. Otherwise the behaviour is intentionally undefined but is it better to throw an Exception, since returning a nonsensical could make debugging more complex for a user.
        Parameters:
        argument - the argument which should be converted
        Returns:
        the converted form of the argument