001package jmri.server.json;
002
003import java.util.Locale;
004import java.util.Objects;
005
006import javax.annotation.Nonnull;
007
008/**
009 * Container for data in JSON request.
010 */
011public class JsonRequest {
012
013    public final int id;
014    public final Locale locale;
015    public final String method;
016    public final String version;
017
018    /**
019     * Create a JSON request container.
020     *
021     * @param locale  the request locale
022     * @param version the JSON version to use
023     * @param method  the JSON method to use
024     * @param id      the ID of the request
025     */
026    public JsonRequest(@Nonnull Locale locale, @Nonnull String version, @Nonnull String method, int id) {
027        Objects.requireNonNull(locale, "Locale must be non-null");
028        Objects.requireNonNull(version, "Version must be specified");
029        this.locale = locale;
030        this.version = version;
031        this.method = method;
032        this.id = id;
033    }
034}