Class ParamConverterUtils


  • public final class ParamConverterUtils
    extends Object
    Helper class to work with parameter converter providers and parameter converters.
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static <T> String getString​(Class<T> type, javax.ws.rs.ext.ParamConverterProvider provider, T value)
      Converts the instance of particular type into its string-based representation using parameter converter provider and available parameter converter.
      static <T> T getValue​(Class<T> type, javax.ws.rs.ext.ParamConverterProvider provider, String value)
      Converts the string-based representation of the value to the instance of particular type using parameter converter provider and available parameter converter.
    • Method Detail

      • getValue

        public static <T> T getValue​(Class<T> type,
                                     javax.ws.rs.ext.ParamConverterProvider provider,
                                     String value)
        Converts the string-based representation of the value to the instance of particular type using parameter converter provider and available parameter converter.
        Parameters:
        type - type to convert from string-based representation
        provider - parameter converter provider to use
        value - the string-based representation to convert
        Returns:
        instance of particular type converter from its string representation
      • getString

        public static <T> String getString​(Class<T> type,
                                           javax.ws.rs.ext.ParamConverterProvider provider,
                                           T value)
        Converts the instance of particular type into its string-based representation using parameter converter provider and available parameter converter.
        Parameters:
        type - type to convert to string-based representation
        provider - parameter converter provider to use
        value - the typed instance to convert to string representation
        Returns:
        string-based representation of the instance of particular type