public static < A > A getRequiredAttachment ( final DeploymentUnit unit , final AttachmentKey < A > key ) { final A value = unit . getAttachment ( key ) ; if ( value == null ) { throw new IllegalStateException ( ) ; } return value ; }
Returns required attachment value from deployment unit .