Class VariantListBuilderImpl


  • @Deprecated
    public class VariantListBuilderImpl
    extends javax.ws.rs.core.Variant.VariantListBuilder
    Deprecated.
    Will be removed in next minor release.
    Concrete implementation of abstract class Variant.VariantListBuilder
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private java.util.List<java.lang.String> encodings
      Deprecated.
       
      private java.util.List<java.util.Locale> languages
      Deprecated.
       
      private java.util.List<javax.ws.rs.core.MediaType> mediaTypes
      Deprecated.
       
      private java.util.List<javax.ws.rs.core.Variant> variants
      Deprecated.
       
    • Constructor Summary

      Constructors 
      Constructor Description
      VariantListBuilderImpl()
      Deprecated.
      Creates a new VariantListBuilder
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods 
      Modifier and Type Method Description
      javax.ws.rs.core.Variant.VariantListBuilder add()
      Deprecated.
      Add the current combination of metadata to the list of supported variants, after this method is called the current combination of metadata is emptied.
      java.util.List<javax.ws.rs.core.Variant> build()
      Deprecated.
      Build a list of representation variants from the current state of the builder.
      private void buildVariants()
      Deprecated.
       
      private static <T> java.util.Iterator<T> createIterator​(java.util.List<T> list)
      Deprecated.
      Creates an Iterator over the elements of the list.
      javax.ws.rs.core.Variant.VariantListBuilder encodings​(java.lang.String... encodings)
      Deprecated.
      Set the encoding[s] for this variant.
      javax.ws.rs.core.Variant.VariantListBuilder languages​(java.util.Locale... languages)
      Deprecated.
      Set the language[s] for this variant.
      javax.ws.rs.core.Variant.VariantListBuilder mediaTypes​(javax.ws.rs.core.MediaType... mediaTypes)
      Deprecated.
      Set the media type[s] for this variant.
      • Methods inherited from class javax.ws.rs.core.Variant.VariantListBuilder

        newInstance
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • encodings

        private java.util.List<java.lang.String> encodings
        Deprecated.
      • languages

        private java.util.List<java.util.Locale> languages
        Deprecated.
      • mediaTypes

        private java.util.List<javax.ws.rs.core.MediaType> mediaTypes
        Deprecated.
      • variants

        private java.util.List<javax.ws.rs.core.Variant> variants
        Deprecated.
    • Constructor Detail

      • VariantListBuilderImpl

        public VariantListBuilderImpl()
        Deprecated.
        Creates a new VariantListBuilder
    • Method Detail

      • createIterator

        private static <T> java.util.Iterator<T> createIterator​(java.util.List<T> list)
        Deprecated.
        Creates an Iterator over the elements of the list. If the list is null or empty, an Iterator with exact one element is returned: null.
        Type Parameters:
        T -
        Parameters:
        list -
        Returns:
        an Iterator with at least one element (perhaps null). never null.
      • add

        public javax.ws.rs.core.Variant.VariantListBuilder add()
        Deprecated.
        Add the current combination of metadata to the list of supported variants, after this method is called the current combination of metadata is emptied. If more than one value is supplied for one or more of the variant properties then a variant will be generated for each possible combination. E.g. in the following list would have four members:

         List<Variant> list = VariantListBuilder.newInstance().languages("en","fr")
           .encodings("zip", "identity").add().build()
         
        Specified by:
        add in class javax.ws.rs.core.Variant.VariantListBuilder
        Returns:
        the updated builder
        See Also:
        Variant.VariantListBuilder.add()
      • build

        public java.util.List<javax.ws.rs.core.Variant> build()
        Deprecated.
        Build a list of representation variants from the current state of the builder. After this method is called the builder is reset to an empty state.
        Specified by:
        build in class javax.ws.rs.core.Variant.VariantListBuilder
        Returns:
        a list of representation variants
        See Also:
        Variant.VariantListBuilder.build()
      • buildVariants

        private void buildVariants()
        Deprecated.
      • encodings

        public javax.ws.rs.core.Variant.VariantListBuilder encodings​(java.lang.String... encodings)
        Deprecated.
        Set the encoding[s] for this variant.
        Specified by:
        encodings in class javax.ws.rs.core.Variant.VariantListBuilder
        Parameters:
        encodings - the available encodings
        Returns:
        the updated builder
        See Also:
        Variant.VariantListBuilder.encodings(java.lang.String[])
      • languages

        public javax.ws.rs.core.Variant.VariantListBuilder languages​(java.util.Locale... languages)
        Deprecated.
        Set the language[s] for this variant.
        Specified by:
        languages in class javax.ws.rs.core.Variant.VariantListBuilder
        Parameters:
        languages - the available languages
        Returns:
        the updated builder
        See Also:
        javax.ws.rs.core.Variant.VariantListBuilder#languages(java.lang.String[])
      • mediaTypes

        public javax.ws.rs.core.Variant.VariantListBuilder mediaTypes​(javax.ws.rs.core.MediaType... mediaTypes)
        Deprecated.
        Set the media type[s] for this variant.
        Specified by:
        mediaTypes in class javax.ws.rs.core.Variant.VariantListBuilder
        Parameters:
        mediaTypes - the available mediaTypes. If specific charsets are supported they should be included as parameters of the respective media type.
        Returns:
        the updated builder
        See Also:
        Variant.VariantListBuilder.mediaTypes(javax.ws.rs.core.MediaType[])