Package com.github.dreamhead.moco.config

Source Code of com.github.dreamhead.moco.config.MocoResponseConfig

package com.github.dreamhead.moco.config;

import com.github.dreamhead.moco.MocoConfig;
import com.github.dreamhead.moco.ResponseHandler;
import com.github.dreamhead.moco.handler.AndResponseHandler;

import static com.google.common.collect.ImmutableList.of;

public class MocoResponseConfig implements MocoConfig<ResponseHandler> {
    private final ResponseHandler handler;

    public MocoResponseConfig(ResponseHandler handler) {
        this.handler = handler;
    }

    @Override
    public boolean isFor(String id) {
        return RESPONSE_ID.equals(id);
    }

    @Override
    public ResponseHandler apply(ResponseHandler target) {
        return new AndResponseHandler(of(handler, target));
    }
}
TOP

Related Classes of com.github.dreamhead.moco.config.MocoResponseConfig

TOP
Copyright © 2018 www.massapi.com. 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.