Package com.github.dreamhead.moco.handler

Examples of com.github.dreamhead.moco.handler.AndResponseHandler


    public T response(final MocoProcedure procedure) {
        return this.response(with(checkNotNull(procedure, "Procedure should not be null")));
    }

    public T response(final ResponseHandler... handlers) {
        return this.response(new AndResponseHandler(copyOf(handlers)));
    }
View Full Code Here


        return RESPONSE_ID.equals(id);
    }

    @Override
    public ResponseHandler apply(ResponseHandler target) {
        return new AndResponseHandler(of(handler, target));
    }
View Full Code Here

    private ResponseHandler getResponseHandler(ImmutableList<ResponseHandler> list) {
        if (list.size() == 1) {
            return list.get(0);
        }

        return new AndResponseHandler(list);
    }
View Full Code Here

        };
    }

    private ResponseHandler createResponseHandler(String name, Object value) {
        if ("json".equalsIgnoreCase(name)) {
            return new AndResponseHandler(of(with(text(toJson(value))), header(HttpHeaders.CONTENT_TYPE, "application/json")));
        }

        if (isResource(name) && TextContainer.class.isInstance(value)) {
            TextContainer container = TextContainer.class.cast(value);
            return with(resourceFrom(name, container));
View Full Code Here

TOP

Related Classes of com.github.dreamhead.moco.handler.AndResponseHandler

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.