001package io.ebeaninternal.dbmigration.migration;
002
003import javax.xml.bind.annotation.XmlEnum;
004import javax.xml.bind.annotation.XmlEnumValue;
005import javax.xml.bind.annotation.XmlType;
006
007
008/**
009 * <p>Java class for identityType.
010 *
011 * <p>The following schema fragment specifies the expected content contained within this class.
012 * <p>
013 * <pre>
014 * &lt;simpleType name="identityType">
015 *   &lt;restriction base="{http://www.w3.org/2001/XMLSchema}string">
016 *     &lt;enumeration value="identity"/>
017 *     &lt;enumeration value="sequence"/>
018 *     &lt;enumeration value="generator"/>
019 *     &lt;enumeration value="external"/>
020 *     &lt;enumeration value="default"/>
021 *   &lt;/restriction>
022 * &lt;/simpleType>
023 * </pre>
024 */
025@XmlType(name = "identityType")
026@XmlEnum
027public enum IdentityType {
028
029  @XmlEnumValue("identity")
030  IDENTITY("identity"),
031  @XmlEnumValue("sequence")
032  SEQUENCE("sequence"),
033  @XmlEnumValue("generator")
034  GENERATOR("generator"),
035  @XmlEnumValue("external")
036  EXTERNAL("external"),
037  @XmlEnumValue("default")
038  DEFAULT("default");
039  private final String value;
040
041  IdentityType(String v) {
042    value = v;
043  }
044
045  public String value() {
046    return value;
047  }
048
049  public static IdentityType fromValue(String v) {
050    for (IdentityType c : IdentityType.values()) {
051      if (c.value.equals(v)) {
052        return c;
053      }
054    }
055    throw new IllegalArgumentException(v);
056  }
057
058}