private ObjectNode createResponseSuccess ( String jsonRpc , Object id , JsonNode result ) { ObjectNode response = mapper . createObjectNode ( ) ; response . put ( JSONRPC , jsonRpc ) ; if ( Integer . class . isInstance ( id ) ) { response . put ( ID , Integer . class . cast ( id ) . intValue ( ) ) ; } else if ( Long . class . isInstance ( id ) ) { response . put ( ID , Long . class . cast ( id ) . longValue ( ) ) ; } else if ( Float . class . isInstance ( id ) ) { response . put ( ID , Float . class . cast ( id ) . floatValue ( ) ) ; } else if ( Double . class . isInstance ( id ) ) { response . put ( ID , Double . class . cast ( id ) . doubleValue ( ) ) ; } else if ( BigDecimal . class . isInstance ( id ) ) { response . put ( ID , BigDecimal . class . cast ( id ) ) ; } else { response . put ( ID , String . class . cast ( id ) ) ; } response . set ( RESULT , result ) ; return response ; }
Creates a success response .