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
  • Method Details

    • selectVariant

      public static Variant selectVariant(InboundMessageContext context, List<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<Variant> selectVariants(InboundMessageContext context, List<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.