Interface MultiValueConverter<S>

    • Method Detail

      • accept

        boolean accept​(java.lang.Class<S> sourceType,
                       java.lang.Class<?> multiValueType)
        Accept the source type and target type or not
        Parameters:
        sourceType - the source type
        multiValueType - the multi-value type
        Returns:
        if accepted, return true, or false
      • convert

        java.lang.Object convert​(S source,
                                 java.lang.Class<?> multiValueType,
                                 java.lang.Class<?> elementType)
        Convert the source to be the multiple value
        Parameters:
        source - the source-typed value
        multiValueType - the multi-value type
        elementType - the element type
        Returns:
      • getSourceType

        default java.lang.Class<S> getSourceType()
        Get the source type
        Returns:
        non-null
      • find

        static MultiValueConverter<?> find​(java.lang.Class<?> sourceType,
                                           java.lang.Class<?> targetType)
        Find the MultiValueConverter instance from ServiceLoader with the specified source and target type
        Parameters:
        sourceType - the source type
        targetType - the target type
        Returns:
        null if not found
      • convertIfPossible

        static <T> T convertIfPossible​(java.lang.Object source,
                                       java.lang.Class<?> multiValueType,
                                       java.lang.Class<?> elementType)