Class VariantSelector

java.lang.Object
org.glassfish.jersey.message.internal.VariantSelector

public final class VariantSelector extends Object
Utility for selecting variant that best matches request from a list of variants.
Author:
Paul Sandoz, Marek Potociar (marek.potociar at oracle.com)
  • Method Details

    • selectVariant

      public static javax.ws.rs.core.Variant selectVariant(InboundMessageContext context, List<javax.ws.rs.core.Variant> variants, org.glassfish.jersey.internal.util.collection.Ref<String> varyHeaderValue)
      Select the representation variant that best matches the request. More explicit variants are chosen ahead of less explicit ones.
      Parameters:
      context - inbound message context.
      variants - list of possible variants.
      varyHeaderValue - an output reference of vary header value that should be put into the response Vary header.
      Returns:
      selected variant.
    • selectVariants

      public static List<javax.ws.rs.core.Variant> selectVariants(InboundMessageContext context, List<javax.ws.rs.core.Variant> variants, org.glassfish.jersey.internal.util.collection.Ref<String> varyHeaderValue)
      Select possible representation variants in order in which they best matches the request.
      Parameters:
      context - inbound message context.
      variants - list of possible variants.
      varyHeaderValue - an output reference of vary header value that should be put into the response Vary header.
      Returns:
      possible variants.