Interface ArgumentConverter

    • Method Detail

      • canConvert

        boolean canConvert​(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

        Object convert​(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