/** * The factory method for the {@link DecodingTransformer}. * @param codec the {@link Codec} to use. * @param typeFunction the target type function. * @param <T> the target type. * @return the {@link DecodingTransformer} instance. * @since 1.2 */ public static <T> DecodingTransformer<T> decoding(Codec codec, Function<Message<?>, Class<T>> typeFunction) { return decoding(codec, new FunctionExpression<Message<?>>(typeFunction)); }
/** * The factory method for the {@link DecodingTransformer}. * @param codec the {@link Codec} to use. * @param typeExpression the target type SpEL expression. * @param <T> the target type. * @return the {@link DecodingTransformer} instance. * @since 1.2 */ public static <T> DecodingTransformer<T> decoding(Codec codec, String typeExpression) { return decoding(codec, PARSER.parseExpression(typeExpression)); }
/** * The factory method for the {@link DecodingTransformer}. * @param codec the {@link Codec} to use. * @param typeFunction the target type function. * @param <T> the target type. * @return the {@link DecodingTransformer} instance. * @since 1.2 */ public static <T> DecodingTransformer<T> decoding(Codec codec, Function<Message<?>, Class<T>> typeFunction) { return decoding(codec, new FunctionExpression<Message<?>>(typeFunction)); }
/** * The factory method for the {@link DecodingTransformer}. * @param codec the {@link Codec} to use. * @param typeExpression the target type SpEL expression. * @param <T> the target type. * @return the {@link DecodingTransformer} instance. * @since 1.2 */ public static <T> DecodingTransformer<T> decoding(Codec codec, String typeExpression) { return decoding(codec, PARSER.parseExpression(typeExpression)); }
@Bean public IntegrationFlow decodingFlow() { return f -> f .transform(Transformers.decoding(new MyCodec(), m -> Integer.class)) .channel("codecReplyChannel"); }