@GET
    @Path("/{variantId}")
    @Produces(MediaType.APPLICATION_JSON)
    public Response findVariantById(@PathParam("variantId") String variantId) {

        Variant variant = variantService.findByVariantID(variantId);

        if (variant == null) {
            return Response.status(Response.Status.NOT_FOUND).entity("Could not find requested Variant").build();
        }

        if (!type.isInstance(variant)) {
            return Response.status(Response.Status.BAD_REQUEST).entity("Requested Variant is of another type/platform").build();
        }

        return Response.ok(variant).build();
    }
@ GET @ Path ( "/{variantId}" ) @ Produces ( MediaType . APPLICATION_JSON ) public Response findVariantById ( @ PathParam ( "variantId" ) String variantId ) { Variant variant = variantService . findByVariantID ( variantId ) ; if ( variant == null ) { return Response . status ( Response . Status . NOT_FOUND ) . entity ( "Could not find requested Variant" ) . build ( ) ; } if ( ! type . isInstance ( variant ) ) { return Response . status ( Response . Status . BAD_REQUEST ) . entity ( "Requested Variant is of another type/platform" ) . build ( ) ; } return Response . ok ( variant ) . build ( ) ; }
Get Variant

@param variantId id of {@link Variant}
@return          requested {@link Variant}

@statuscode 400 The requested Variant resource exists but it is not of the given type
@statuscode 404 The requested Variant resource does not exist