Class Converter


  • @Deprecated
    public class Converter
    extends java.lang.Object
    Deprecated.
    Will be removed in next minor release.
    This utility class converts Restlet objects to it correponding JAX-RS objects and vice versa.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private static java.lang.String CHARSET_PARAM
      Deprecated.
      Paramater in the JAX-RS MediaType for the charset.
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      private Converter()
      Deprecated.
       
    • Method Summary

      All Methods Static Methods Concrete Methods Deprecated Methods 
      Modifier and Type Method Description
      static java.lang.String getCharset​(javax.ws.rs.core.MediaType mediaType)
      Deprecated.
      Returns the charset of the MediaType as String
      static javax.ws.rs.core.MediaType getMediaTypeWithoutParams​(javax.ws.rs.core.MediaType mediaType)
      Deprecated.
      Creates a MediaType without any parameters.
      static MediaType getMediaTypeWithoutParams​(MediaType mediaType)
      Deprecated.
      Creates a MediaType without any parameters.
      static CharacterSet getRestletCharacterSet​(javax.ws.rs.core.MediaType mediaType)
      Deprecated.
      Returns the Charset of the MediaType as String
      static Form toForm​(javax.ws.rs.core.MultivaluedMap<java.lang.String,​java.lang.String> mmap)
      Deprecated.
      Copies the data in the MultivaluedMap to the Form.
      static Form toFormEncoded​(java.lang.String queryString)
      Deprecated.
      Converts the given query String to a Form, but do not decode the data.
      static javax.ws.rs.core.CacheControl toJaxRsCacheControl​(java.util.List<CacheDirective> cacheDirectives)
      Deprecated.
       
      static javax.ws.rs.core.Cookie toJaxRsCookie​(Cookie restletCookie)
      Deprecated.
      Converts a Restlet Cookie to a JAX-RS Cookie
      static javax.ws.rs.core.EntityTag toJaxRsEntityTag​(Tag restletEntityTag)
      Deprecated.
      Converts a Restlet-EntityTag to a JAX-RS-EntityTag
      static javax.ws.rs.core.MediaType toJaxRsMediaType​(MediaType restletMediaType)
      Deprecated.
      Convert a Restlet MediaType to a JAX-RS MediaType.
      static javax.ws.rs.core.MediaType toJaxRsMediaType​(MediaType restletMediaType, CharacterSet restletCharacterSet)
      Deprecated.
      Convert a Restlet MediaType to a JAX-RS MediaType.
      static javax.ws.rs.core.NewCookie toJaxRsNewCookie​(CookieSetting cookieSetting)
      Deprecated.
      Converts the Restlet CookieSettings to a JAX-RS NewCookie.
      static javax.ws.rs.core.Variant toJaxRsVariant​(Variant restletVariant)
      Deprecated.
      Converts the given Restlet Variant to a JAX-RS Variant
      static Language toLanguage​(java.lang.String locale)
      Deprecated.
       
      static Language toLanguage​(java.util.Locale locale)
      Deprecated.
       
      static java.lang.String toLanguageString​(java.util.Locale locale)
      Deprecated.
       
      static java.util.Locale toLocale​(java.lang.String language)
      Deprecated.
      Converts a locale String to a Restlet Language.
      static java.util.Locale toLocale​(Language language)
      Deprecated.
      Converts a Locale to a Restlet Language.
      static java.util.Map<java.lang.String,​java.lang.String> toMap​(Series<Parameter> parameters)
      Deprecated.
       
      static java.util.List<CacheDirective> toRestletCacheDirective​(javax.ws.rs.core.CacheControl cacheControl)
      Deprecated.
       
      static Cookie toRestletCookie​(javax.ws.rs.core.Cookie jaxRsCookie)
      Deprecated.
      Converts a JAX-RS Cookie to a Restlet Cookie
      static CookieSetting toRestletCookieSetting​(javax.ws.rs.core.NewCookie newCookie)
      Deprecated.
      Converts the Restlet JAX-RS NewCookie to a CookieSettings.
      static MediaType toRestletMediaType​(javax.ws.rs.core.MediaType jaxRsMediaType)
      Deprecated.
      Convert a JAX-RS MediaType to a Restlet MediaType.
      static Form toRestletSeries​(java.util.Map<java.lang.String,​java.lang.String> parameters)
      Deprecated.
       
      static Tag toRestletTag​(javax.ws.rs.core.EntityTag jaxRsEntityTag)
      Deprecated.
      Converts a JAX-RS-EntityTag to a Restlet-EntityTag
      static java.util.List<Variant> toRestletVariants​(java.util.Collection<javax.ws.rs.core.Variant> jaxRsVariants)
      Deprecated.
      Converts the given JAX-RS Variants to Restlet Variants.
      • Methods inherited from class java.lang.Object

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

      • CHARSET_PARAM

        private static final java.lang.String CHARSET_PARAM
        Deprecated.
        Paramater in the JAX-RS MediaType for the charset. See MIME specification.
        See Also:
        Constant Field Values
    • Constructor Detail

      • Converter

        private Converter()
        Deprecated.
    • Method Detail

      • getCharset

        public static java.lang.String getCharset​(javax.ws.rs.core.MediaType mediaType)
        Deprecated.
        Returns the charset of the MediaType as String
        Parameters:
        mediaType - JaxRs-MediaType
        Returns:
        the charset
      • getMediaTypeWithoutParams

        public static javax.ws.rs.core.MediaType getMediaTypeWithoutParams​(javax.ws.rs.core.MediaType mediaType)
        Deprecated.
        Creates a MediaType without any parameters.
        Parameters:
        mediaType - A MediaType, perhaps with parameters.
        Returns:
        Creates a MediaType without any parameters.
      • getMediaTypeWithoutParams

        public static MediaType getMediaTypeWithoutParams​(MediaType mediaType)
        Deprecated.
        Creates a MediaType without any parameters.
        Parameters:
        mediaType - A MediaType, perhaps with parameters.
        Returns:
        Creates a MediaType without any parameters.
      • getRestletCharacterSet

        public static CharacterSet getRestletCharacterSet​(javax.ws.rs.core.MediaType mediaType)
        Deprecated.
        Returns the Charset of the MediaType as String
        Parameters:
        mediaType - JaxRs-MediaType
        Returns:
        the charset
      • toForm

        public static Form toForm​(javax.ws.rs.core.MultivaluedMap<java.lang.String,​java.lang.String> mmap)
        Deprecated.
        Copies the data in the MultivaluedMap to the Form.
        Parameters:
        mmap -
        Returns:
        the converted Http headers or null, if null was given.
      • toFormEncoded

        public static Form toFormEncoded​(java.lang.String queryString)
        Deprecated.
        Converts the given query String to a Form, but do not decode the data.
        Parameters:
        queryString -
        Returns:
        the encoded form
      • toJaxRsCacheControl

        public static javax.ws.rs.core.CacheControl toJaxRsCacheControl​(java.util.List<CacheDirective> cacheDirectives)
        Deprecated.
        Parameters:
        cacheDirectives -
        Returns:
        the converted JAX-RS CacheControl
      • toJaxRsCookie

        public static javax.ws.rs.core.Cookie toJaxRsCookie​(Cookie restletCookie)
        Deprecated.
        Converts a Restlet Cookie to a JAX-RS Cookie
        Parameters:
        restletCookie - the Restlet Cookie
        Returns:
        the JAX-RS Cookie
      • toJaxRsEntityTag

        public static javax.ws.rs.core.EntityTag toJaxRsEntityTag​(Tag restletEntityTag)
        Deprecated.
        Converts a Restlet-EntityTag to a JAX-RS-EntityTag
        Parameters:
        restletEntityTag - the Restlet-EntityTag to convert.
        Returns:
        The corresponding JAX-RS-Entity-Tag
      • toJaxRsMediaType

        public static javax.ws.rs.core.MediaType toJaxRsMediaType​(MediaType restletMediaType)
        Deprecated.
        Convert a Restlet MediaType to a JAX-RS MediaType.
        Parameters:
        restletMediaType - the MediaType to convert.
        restletCharacterSet - the CharacterSet for the MediaType; may be null.
        Returns:
        the converted MediaType
      • toJaxRsMediaType

        public static javax.ws.rs.core.MediaType toJaxRsMediaType​(MediaType restletMediaType,
                                                                  CharacterSet restletCharacterSet)
        Deprecated.
        Convert a Restlet MediaType to a JAX-RS MediaType.
        Parameters:
        restletMediaType - the MediaType to convert.
        restletCharacterSet - the CharacterSet for the MediaType; may be null.
        Returns:
        the converted MediaType
      • toJaxRsNewCookie

        public static javax.ws.rs.core.NewCookie toJaxRsNewCookie​(CookieSetting cookieSetting)
                                                           throws java.lang.IllegalArgumentException
        Deprecated.
        Converts the Restlet CookieSettings to a JAX-RS NewCookie.
        Parameters:
        cookieSetting -
        Returns:
        the JAX-RS NewCookie
        Throws:
        java.lang.IllegalArgumentException
      • toJaxRsVariant

        public static javax.ws.rs.core.Variant toJaxRsVariant​(Variant restletVariant)
                                                       throws java.lang.IllegalArgumentException
        Deprecated.
        Converts the given Restlet Variant to a JAX-RS Variant
        Parameters:
        restletVariant -
        Returns:
        the JAX-RS Variant
        Throws:
        java.lang.IllegalArgumentException - If the given Variant does not contain exactly one language and one
      • toLanguage

        public static Language toLanguage​(java.util.Locale locale)
        Deprecated.
        Parameters:
        locale -
        Returns:
        the Restlet Language
      • toLanguage

        public static Language toLanguage​(java.lang.String locale)
        Deprecated.
        Parameters:
        locale -
        Returns:
        the Restlet Language
      • toLanguageString

        public static java.lang.String toLanguageString​(java.util.Locale locale)
        Deprecated.
        Parameters:
        locale -
        Returns:
        the language string
        See Also:
        toLanguage(Locale)
      • toLocale

        public static java.util.Locale toLocale​(Language language)
        Deprecated.
        Converts a Locale to a Restlet Language.
        Parameters:
        language -
        Returns:
        the Locale
        See Also:
        toLocale(String), Locale
      • toLocale

        public static java.util.Locale toLocale​(java.lang.String language)
        Deprecated.
        Converts a locale String to a Restlet Language.
        Parameters:
        language -
        Returns:
        the Locale
        See Also:
        toLocale(Language), Locale
      • toMap

        public static java.util.Map<java.lang.String,​java.lang.String> toMap​(Series<Parameter> parameters)
        Deprecated.
        Parameters:
        parameters -
        Returns:
        the Map
      • toRestletCacheDirective

        public static java.util.List<CacheDirective> toRestletCacheDirective​(javax.ws.rs.core.CacheControl cacheControl)
        Deprecated.
        Parameters:
        cacheControl -
        Returns:
        the converted CacheDirective
      • toRestletCookie

        public static Cookie toRestletCookie​(javax.ws.rs.core.Cookie jaxRsCookie)
        Deprecated.
        Converts a JAX-RS Cookie to a Restlet Cookie
        Parameters:
        jaxRsCookie - the JAX-RS Cookie
        Returns:
        the Restlet Cookie
      • toRestletCookieSetting

        public static CookieSetting toRestletCookieSetting​(javax.ws.rs.core.NewCookie newCookie)
                                                    throws java.lang.IllegalArgumentException
        Deprecated.
        Converts the Restlet JAX-RS NewCookie to a CookieSettings.
        Parameters:
        newCookie -
        Returns:
        the converted CookieSetting
        Throws:
        java.lang.IllegalArgumentException
      • toRestletMediaType

        public static MediaType toRestletMediaType​(javax.ws.rs.core.MediaType jaxRsMediaType)
        Deprecated.
        Convert a JAX-RS MediaType to a Restlet MediaType.
        Parameters:
        jaxRsMediaType -
        Returns:
        the converted MediaType
      • toRestletSeries

        public static Form toRestletSeries​(java.util.Map<java.lang.String,​java.lang.String> parameters)
        Deprecated.
        Parameters:
        parameters -
        Returns:
        a form with the given parameters. Will never return null.
      • toRestletTag

        public static Tag toRestletTag​(javax.ws.rs.core.EntityTag jaxRsEntityTag)
        Deprecated.
        Converts a JAX-RS-EntityTag to a Restlet-EntityTag
        Parameters:
        jaxRsEntityTag - the JAX-RS-EntityTag to convert.
        Returns:
        The corresponding Restlet-Entity-Tag
      • toRestletVariants

        public static java.util.List<Variant> toRestletVariants​(java.util.Collection<javax.ws.rs.core.Variant> jaxRsVariants)
        Deprecated.
        Converts the given JAX-RS Variants to Restlet Variants.
        Parameters:
        jaxRsVariants -
        Returns:
        the List of Restlet Variants