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

com.github.dreamhead.moco.parser.model.ReplayModifierContainer 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.databind.annotation.JsonDeserialize;
import com.github.dreamhead.moco.ResponseElement;
import com.github.dreamhead.moco.parser.deserializer.ReplayModifierContainerDeserializer;

import static com.github.dreamhead.moco.Moco.template;
import static com.github.dreamhead.moco.Moco.with;

@JsonDeserialize(using = ReplayModifierContainerDeserializer.class)
public class ReplayModifierContainer {
    private String text;
    private ResponseSetting setting;

    public ReplayModifierContainer(final String text) {
        this.text = text;
    }

    public ReplayModifierContainer(final ResponseSetting setting) {
        this.setting = setting;
    }

    public final ResponseElement getResponseHandler() {
        if (text != null) {
            return with(template(text));
        }

        return this.setting.getResponseHandler();
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy