Class CallbackUtil


  • public final class CallbackUtil
    extends Object
    Helper utility methods for callback handlers.
    Author:
    David M. Lloyd
    • Constructor Detail

      • CallbackUtil

        private CallbackUtil()
    • Method Detail

      • isOptional

        public static boolean isOptional​(Callback callback)
        Determine whether a callback is optional.
        Parameters:
        callback - the callback
        Returns:
        true if it is optional, false if it is not optional or optionality could not be determined
      • unsupported

        public static void unsupported​(Callback callback)
                                throws UnsupportedCallbackException
        A utility to handle a callback which is unsupported. Optional callbacks will be ignored, otherwise the exception will be thrown. In the case of optional callbacks, this method will return.
        Parameters:
        callback - the callback which is not supported
        Throws:
        UnsupportedCallbackException - if the callback is not optional