@ SuppressWarnings ( "unchecked" ) private < T extends IEntity > T retrieveEntity ( IntuitMessage intuitMessage ) { T returnEntity = null ; IntuitResponse intuitResponse = ( IntuitResponse ) intuitMessage . getResponseElements ( ) . getResponse ( ) ; if ( intuitResponse != null ) { JAXBElement < ? extends IntuitEntity > intuitObject = intuitResponse . getIntuitObject ( ) ; if ( intuitObject != null ) { returnEntity = ( ( T ) intuitObject . getValue ( ) ) ; } } return returnEntity ; }
Common method to retrieve result entity from IntuitMessage