io.gdcc.xoai.model.oaipmh.Granularity Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of xoai-common Show documentation
Show all versions of xoai-common Show documentation
OAI-PMH base functionality used for both data and service providers.
/*
* 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 io.gdcc.xoai.model.oaipmh;
/**
* @author Development @ Lyncode
* @version 3.1.0
*/
public enum Granularity {
Day("YYYY-MM-DD"),
Second("YYYY-MM-DDThh:mm:ssZ"),
// Lenient defaults to Second granularity, but can be used to accept Day granularity, too
Lenient(Second.representation);
public static Granularity fromRepresentation(String representation) {
for (Granularity granularity : Granularity.values())
if (granularity.toString().equals(representation)) return granularity;
throw new IllegalArgumentException(representation);
}
private final String representation;
Granularity(String representation) {
this.representation = representation;
}
@Override
public String toString() {
return representation;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy