Java Code Examples for java.util.function.Function.compose()

The following are Jave code examples for showing how to use compose() of the java.util.function.Function class. You can vote up the examples you like. Your votes will be used in our system to get more good examples.
+ Save this method
Example 1
Project: verify-matching-service-adapter   File: MsaTransformersFactory.java   View Source Code Vote up 6 votes
public Function<OutboundResponseFromUnknownUserCreationService, Element> getOutboundResponseFromUnknownUserCreationServiceToElementTransformer(
        final EncryptionKeyStore encryptionKeyStore,
        final IdaKeyStore keyStore,
        final EntityToEncryptForLocator entityToEncryptForLocator,
        MatchingServiceAdapterConfiguration configuration) {
    Function<OutboundResponseFromUnknownUserCreationService, Response> t1 =
            new OutboundResponseFromUnknownUserCreationServiceToSamlResponseTransformer(
                    new OpenSamlXmlObjectFactory(),
                    new UnknownUserCreationIdaStatusMarshaller(new OpenSamlXmlObjectFactory()),
                    createMatchingServiceAssertionToAssertionTransformer()
            );
    Function<Response, Element> t2 = getResponseToElementTransformer(
            encryptionKeyStore,
            keyStore,
            entityToEncryptForLocator,
            configuration);
    return t2.compose(t1);
}
 
Example 2
Project: verify-matching-service-adapter   File: MsaTransformersFactory.java   View Source Code Vote up 6 votes
public Function<OutboundResponseFromMatchingService, Element> getOutboundResponseFromMatchingServiceToElementTransformer(
        final EncryptionKeyStore encryptionKeyStore,
        final IdaKeyStore keyStore,
        final EntityToEncryptForLocator entityToEncryptForLocator,
        MatchingServiceAdapterConfiguration configuration) {
    Function<OutboundResponseFromMatchingService, Response> t1 = new OutboundResponseFromMatchingServiceToSamlResponseTransformer(
            new MatchingServiceIdaStatusMarshaller(new OpenSamlXmlObjectFactory()),
            new OpenSamlXmlObjectFactory(),
            createMatchingServiceAssertionToAssertionTransformer()
    );
    Function<Response, Element> t2 = getResponseToElementTransformer(
            encryptionKeyStore,
            keyStore,
        entityToEncryptForLocator,
        configuration);
    return t2.compose(t1);
}
 
Example 3
Project: mpd-2017-i41d   File: Loggify.java   View Source Code Vote up 5 votes
/**
 * 3r approach
 */
public static <T,R> Function<T,R> of(Function<T,R> inner, String msg) {
    return inner.compose(arg -> {
        out.println(msg);
        return arg;
    });
}
 
Example 4
Project: mpd-2017-i41d   File: Loggify.java   View Source Code Vote up 5 votes
/**
 * 3r approach
 */
public static <T,R> Function<T,R> of(Function<T,R> inner, String msg) {
    return inner.compose(arg -> {
        out.println(msg);
        return arg;
    });
}
 
Example 5
Project: mpd-2017-i41d   File: Loggify.java   View Source Code Vote up 5 votes
/**
 * 3r approach
 */
public static <T,R> Function<T,R> of(Function<T,R> inner, String msg) {
    return inner.compose(arg -> {
        out.println(msg);
        return arg;
    });
}
 
Example 6
Project: mpd-2017-i41d   File: Loggify.java   View Source Code Vote up 5 votes
/**
 * 3r approach
 */
public static <T,R> Function<T,R> of(Function<T,R> inner, String msg) {
    return inner.compose(arg -> {
        out.println(msg);
        return arg;
    });
}
 
Example 7
Project: mpd-2017-i41d   File: Loggify.java   View Source Code Vote up 5 votes
/**
 * 3r approach
 */
public static <T,R> Function<T,R> of(Function<T,R> inner, String msg) {
    return inner.compose(arg -> {
        out.println(msg);
        return arg;
    });
}
 
Example 8
Project: mpd-2017-i41d   File: Loggify.java   View Source Code Vote up 5 votes
/**
 * 3r approach
 */
public static <T,R> Function<T,R> of(Function<T,R> inner, String msg) {
    return inner.compose(arg -> {
        out.println(msg);
        return arg;
    });
}
 
Example 9
Project: mpd-2017-i41d   File: Loggify.java   View Source Code Vote up 5 votes
/**
 * 3r approach
 */
public static <T,R> Function<T,R> of(Function<T,R> inner, String msg) {
    return inner.compose(arg -> {
        out.println(msg);
        return arg;
    });
}
 
Example 10
Project: mpd-2017-i41d   File: Loggify.java   View Source Code Vote up 5 votes
/**
 * 3r approach
 */
public static <T,R> Function<T,R> of(Function<T,R> inner, String msg) {
    return inner.compose(arg -> {
        out.println(msg);
        return arg;
    });
}
 
Example 11
Project: verify-matching-service-adapter   File: MsaTransformersFactory.java   View Source Code Vote up 5 votes
public Function<HealthCheckResponseFromMatchingService, Element> getHealthcheckResponseFromMatchingServiceToElementTransformer(
        final EncryptionKeyStore encryptionKeyStore,
        final IdaKeyStore keyStore,
        final EntityToEncryptForLocator entityToEncryptForLocator,
        MatchingServiceAdapterConfiguration configuration
){
    Function<HealthCheckResponseFromMatchingService, Response> t1 = getHealthCheckResponseFromMatchingServiceToResponseTransformer();
    Function<Response, Element> t2 = getResponseToElementTransformer(
            encryptionKeyStore,
            keyStore,
            entityToEncryptForLocator,
            configuration);
    return t2.compose(t1);
}
 
Example 12
Project: verify-matching-service-adapter   File: MsaTransformersFactory.java   View Source Code Vote up 4 votes
public Function<MatchingServiceAssertion, String> getMatchingServiceAssertionToStringTransformer() {
    Function<MatchingServiceAssertion, Assertion> matchingServiceAssertionToAssertionTransformer = createMatchingServiceAssertionToAssertionTransformer();
    Function<Assertion, String> assertionToStringTransformer = new XmlObjectToBase64EncodedStringTransformer<>();
    return assertionToStringTransformer.compose(matchingServiceAssertionToAssertionTransformer);
}