//
// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.10 in JDK 6
// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
// Any modifications to this file will be lost upon recompilation of the source schema.
// Generated on: 2014.01.21 at 01:52:19 PM IST
//
package io.github.jeddict.jpa.spec;

import io.github.jeddict.source.MemberExplorer;
import jakarta.xml.bind.annotation.XmlEnum;
import jakarta.xml.bind.annotation.XmlType;

/**
 * <p>
 * Java class for temporal-type.
 *
 * <p>
 * The following schema fragment specifies the expected content contained within
 * this class.
 * <p>
 * <
 * pre>
 * &lt;simpleType name="temporal-type"> &lt;restriction
 * base="{http://www.w3.org/2001/XMLSchema}token"> &lt;enumeration
 * value="DATE"/> &lt;enumeration value="TIME"/> &lt;enumeration
 * value="TIMESTAMP"/> &lt;/restriction> &lt;/simpleType>
 * </pre>
 *
 */
@XmlType(name = "temporal-type")
@XmlEnum
public enum TemporalType {

    DATE,
    TIME,
    TIMESTAMP;

    public String value() {
        return name();
    }

    public static TemporalType fromValue(String v) {
        return valueOf(v);
    }

    public static TemporalType load(MemberExplorer member) {
        return member
                .getEnumAttribute(jakarta.persistence.Temporal.class, "value")
                .map(TemporalType::valueOf)
                .orElse(null);
    }

    public static TemporalType loadMapKey(MemberExplorer member) {
        return member
                .getEnumAttribute(jakarta.persistence.MapKeyTemporal.class, "value")
                .map(TemporalType::valueOf)
                .orElse(null);
    }

}
