Interface ConversionContext

    • Method Detail

      • getTypeVariables

        default java.util.Map<java.lang.String,​Argument<?>> getTypeVariables()
        In the case where the type to be converted contains generic type arguments this map will return the concrete types of those arguments. For example for the Map type two keys will be present called 'K' and 'V' with the actual types of the key and value.
        Specified by:
        getTypeVariables in interface TypeVariableResolver
        Returns:
        A map of type variables
      • getLocale

        default java.util.Locale getLocale()
        Returns:
        The locale to use
      • getCharset

        default java.nio.charset.Charset getCharset()
        Returns:
        The standard charset used in conversion
      • with

        default <T> ArgumentConversionContext<T> with​(Argument<T> argument)
        Augment this context with data for the given argument.
        Type Parameters:
        T - type Generic
        Parameters:
        argument - The argument
        Returns:
        The conversion context
      • of

        static ConversionContext of​(java.util.Map<java.lang.String,​Argument<?>> typeVariables)
        Create a simple ConversionContext for the given generic type variables.
        Parameters:
        typeVariables - The type variables
        Returns:
        The conversion context
      • of

        static <T> ArgumentConversionContext<T> of​(Argument<T> argument)
        Create a new simple ConversionContext for the given generic type variables.

        NOTE: The instance returned by this method is NOT thread safe and should be shared via static state or between threads. Consider using ImmutableArgumentConversionContext for this case.

        Type Parameters:
        T - type Generic
        Parameters:
        argument - The argument
        Returns:
        The conversion context
      • of

        static <T> ArgumentConversionContext<T> of​(java.lang.Class<T> argument)
        Create a simple ConversionContext for the given generic type variables.

        NOTE: The instance returned by this method is NOT thread safe and should be shared via static state or between threads. Consider using ImmutableArgumentConversionContext for this case.

        Type Parameters:
        T - type Generic
        Parameters:
        argument - The argument
        Returns:
        The conversion context
      • of

        static <T> ArgumentConversionContext of​(Argument<T> argument,
                                                @Nullable
                                                java.util.Locale locale)
        Create a simple ConversionContext for the given generic type variables.

        NOTE: The instance returned by this method is NOT thread safe and should be shared via static state or between threads. Consider using ImmutableArgumentConversionContext for this case.

        Type Parameters:
        T - type Generic
        Parameters:
        argument - The argument
        locale - The locale
        Returns:
        The conversion context
      • of

        static <T> ArgumentConversionContext<T> of​(Argument<T> argument,
                                                   @Nullable
                                                   java.util.Locale locale,
                                                   @Nullable
                                                   java.nio.charset.Charset charset)
        Create a simple ConversionContext for the given generic type variables.

        NOTE: The instance returned by this method is NOT thread safe and should be shared via static state or between threads. Consider using ImmutableArgumentConversionContext for this case.

        Type Parameters:
        T - type Generic
        Parameters:
        argument - The argument
        locale - The locale
        charset - The charset
        Returns:
        The conversion context