Class ConverterAdapter<S,​T>

    • Method Summary

      All Methods Instance Methods Abstract Methods Concrete Methods 
      Modifier and Type Method Description
      boolean canConvert​(java.lang.Class aSourceClass, java.lang.Class aDestinationClass)
      Returns true if this converter can convert instances of sourceClass to destinationClass.
      T convert​(S source)
      Converts instance of S to T.
      protected abstract java.lang.Class<T> destinationClass()  
      protected abstract T doConvert​(S source)
      Converts instance of S to T.
      protected abstract java.lang.Class<S> sourceClass()  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • ConverterAdapter

        public ConverterAdapter()
    • Method Detail

      • canConvert

        public boolean canConvert​(java.lang.Class aSourceClass,
                                  java.lang.Class aDestinationClass)
        Description copied from interface: Converter
        Returns true if this converter can convert instances of sourceClass to destinationClass.
        Specified by:
        canConvert in interface Converter<S,​T>
        Parameters:
        aSourceClass - source Class
        aDestinationClass - destination Class
        Returns:
        true if this converter can convert instances of sourceClass to destinationClass, false otherwise
      • sourceClass

        protected abstract java.lang.Class<S> sourceClass()
      • destinationClass

        protected abstract java.lang.Class<T> destinationClass()
      • convert

        public T convert​(S source)
        Description copied from interface: Converter
        Converts instance of S to T.
        Specified by:
        convert in interface Converter<S,​T>
        Parameters:
        source - instance of S
        Returns:
        instance of S converted to type T
      • doConvert

        protected abstract T doConvert​(S source)
                                throws java.lang.Exception
        Converts instance of S to T.
        Parameters:
        source - instance of S, can be null
        Returns:
        instance of S converted to type T
        Throws:
        java.lang.Exception