Interface Coercable


  • public interface Coercable
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      java.lang.Object coerceTo​(java.lang.Class<?> destinationClass)
      Attempt to convert this Coercable into the destinationClass.
    • Method Detail

      • coerceTo

        java.lang.Object coerceTo​(java.lang.Class<?> destinationClass)
                           throws java.lang.ClassCastException
        Attempt to convert this Coercable into the destinationClass. Throws ClassCastException if the desired class is not allowed.
        Parameters:
        destinationClass - Class desired...
        Returns:
        An Object cast to destinationClass.
        Throws:
        java.lang.ClassCastException - thrown if this Coercable cannot be cast to the destinationClass.