All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.github.dreamhead.moco.parser.model.GlobalSetting Maven / Gradle / Ivy

Go to download

Moco is an easy setup stub framework, mainly focusing on testing and integration.

There is a newer version: 1.5.0
Show newest version
package com.github.dreamhead.moco.parser.model;

import com.fasterxml.jackson.annotation.JsonAutoDetect;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.github.dreamhead.moco.util.Globs;
import com.google.common.base.MoreObjects;
import com.google.common.collect.ImmutableList;

import static com.github.dreamhead.moco.util.Files.join;

@JsonAutoDetect(fieldVisibility = JsonAutoDetect.Visibility.ANY)
public final class GlobalSetting {
    private String include;
    private String context;
    @JsonProperty("file_root")
    private String fileRoot;
    private String env;
    private RequestSetting request;
    private ResponseSetting response;

    public ImmutableList includes() {
        return Globs.glob(join(fileRoot, include));
    }

    public String getContext() {
        return context;
    }

    public String getFileRoot() {
        return fileRoot;
    }

    public String getEnv() {
        return env;
    }

    public RequestSetting getRequest() {
        return request;
    }

    public ResponseSetting getResponse() {
        return response;
    }

    @Override
    public String toString() {
        return MoreObjects.toStringHelper(this)
                .omitNullValues()
                .add("include", include)
                .add("context", context)
                .add("file root", fileRoot)
                .add("env", env)
                .add("request", request)
                .add("response", response)
                .toString();
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy