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

org.dspace.xoai.model.oaipmh.Granularity Maven / Gradle / Ivy

The newest version!
/*
 * The contents of this file are subject to the license and copyright
 * detailed in the LICENSE and NOTICE files at the root of the source
 * tree and available online at
 *
 * http://www.dspace.org/license/
 */

package org.dspace.xoai.model.oaipmh;

/**
 * @author Development @ Lyncode
 * @version 3.1.0
 */
public enum Granularity {
    Day("YYYY-MM-DD"),
    Second("YYYY-MM-DDThh:mm:ssZ");

    public static Granularity fromRepresentation (String representation) {
        for (Granularity granularity : Granularity.values())
            if (granularity.toString().equals(representation))
                return granularity;

        throw new IllegalArgumentException(representation);
    }

    private String representation;

    Granularity (String representation) {
        this.representation = representation;
    }

    public String toString () {
        return representation;
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy