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

no.ssb.jsonstat.JsonStat Maven / Gradle / Ivy

The newest version!
package no.ssb.jsonstat;

import com.fasterxml.jackson.annotation.JsonProperty;

/**
 * Created by hadrien on 07/06/16.
 *
 * @see json-stat.org/format/#version
 */
public class JsonStat {

    private final Version version;

    private final Class clazz;

    public JsonStat(Version version, Class clazz) {
        this.version = version;
        this.clazz = clazz;
    }

    public String getVersion() {
        return version.getTag();
    }

    @JsonProperty("class")
    public String getClazz() {
        return clazz.toString().toLowerCase();
    }

    public enum Version {

        ONE("1.0"), TWO("2.0");

        private final String tag;

        Version(final String tag) {
            this.tag = tag;
        }

        String getTag() {
            return this.tag;
        }
    }

    public enum Class {
        DATASET,
        DIMENSION,
        COLLECTION
    }

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy