Class ConverterUtils

java.lang.Object
de.hybris.platform.searchservices.util.ConverterUtils

public final class ConverterUtils extends Object
Converter utilities.
  • Method Summary

    Modifier and Type
    Method
    Description
    static final <C, S, T> T
    convert(C context, S source, BiFunction<C,S,T> converter)
    Convert a single source value using the converter function and an additional context.
    static final <S, T> T
    convert(S source, Function<S,T> converter)
    Convert a single source value using the converter function.
    static final <S, T> List<T>
    convertAll(Collection<? extends S> source, Function<S,T> converter)
    Convert a collection of source values using the converter function.
    static final <S, T> List<T>
    convertAll(Collection<? extends S> source, Function<S,T> converter, Predicate<? super S> filter)
    Convert a collection of source values using the converter function.
    static final <P, S, T> List<T>
    convertAll(P first, Collection<S> source, BiFunction<P,S,T> converter)
    Convert a collection of source value using the converter function and an additional context.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Method Details

    • convert

      public static final <S, T> T convert(S source, Function<S,T> converter)
      Convert a single source value using the converter function.
      Type Parameters:
      S - - source type
      T - - target type
      Parameters:
      source - - source value
      converter - - converter function
      Returns:
      converted value
    • convert

      public static final <C, S, T> T convert(C context, S source, BiFunction<C,S,T> converter)
      Convert a single source value using the converter function and an additional context.
      Type Parameters:
      C - - context type
      S - - source type
      T - - target type
      Parameters:
      context - - context
      source - - source value
      converter - - converter function
      Returns:
      converted value
    • convertAll

      public static final <S, T> List<T> convertAll(Collection<? extends S> source, Function<S,T> converter)
      Convert a collection of source values using the converter function.
      Type Parameters:
      S - - source type
      T - - target type
      Parameters:
      source - - source value
      converter - - converter function
      Returns:
      list of converted values
    • convertAll

      public static final <P, S, T> List<T> convertAll(P first, Collection<S> source, BiFunction<P,S,T> converter)
      Convert a collection of source value using the converter function and an additional context.
      Type Parameters:
      C - - context type
      S - - source type
      T - - target type
      Parameters:
      context - - context
      source - - source value
      converter - - converter function
      Returns:
      list of converted values
    • convertAll

      public static final <S, T> List<T> convertAll(Collection<? extends S> source, Function<S,T> converter, Predicate<? super S> filter)
      Convert a collection of source values using the converter function.
      Type Parameters:
      S - - source type
      T - - target type
      Parameters:
      source - - source value
      converter - - converter function
      filter - - filter
      Returns:
      list of converted values