ezvcard
Enum VCardVersion

java.lang.Object
  extended by java.lang.Enum<VCardVersion>
      extended by ezvcard.VCardVersion
All Implemented Interfaces:
Serializable, Comparable<VCardVersion>

public enum VCardVersion
extends Enum<VCardVersion>

Contains all possible vCard versions.

Author:
George El-Haddad, Michael Angstadt

Enum Constant Summary
V2_1
           
V3_0
           
V4_0
           
 
Method Summary
 String getVersion()
          Gets the text representation of this version.
 String getXmlNamespace()
          Gets the XML namespace of this version.
 String toString()
           
static VCardVersion valueOf(String name)
          Returns the enum constant of this type with the specified name.
static VCardVersion valueOfByStr(String value)
          Gets a VCardVersion instance based on the given text representation.
static VCardVersion valueOfByXmlNamespace(String ns)
          Gets a VCardVersion instance based on the given XML namespace.
static VCardVersion[] values()
          Returns an array containing the constants of this enum type, in the order they are declared.
 
Methods inherited from class java.lang.Enum
clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, valueOf
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Enum Constant Detail

V2_1

public static final VCardVersion V2_1

V3_0

public static final VCardVersion V3_0

V4_0

public static final VCardVersion V4_0
Method Detail

values

public static VCardVersion[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
for (VCardVersion c : VCardVersion.values())
    System.out.println(c);

Returns:
an array containing the constants of this enum type, in the order they are declared

valueOf

public static VCardVersion valueOf(String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)

Parameters:
name - the name of the enum constant to be returned.
Returns:
the enum constant with the specified name
Throws:
IllegalArgumentException - if this enum type has no constant with the specified name
NullPointerException - if the argument is null

getVersion

public String getVersion()
Gets the text representation of this version.

Returns:
the text representation

getXmlNamespace

public String getXmlNamespace()
Gets the XML namespace of this version.

Returns:
the XML namespace or null if this version does not support xCard

valueOfByStr

public static VCardVersion valueOfByStr(String value)
Gets a VCardVersion instance based on the given text representation.

Parameters:
value - the text representation
Returns:
the object or null if not found

valueOfByXmlNamespace

public static VCardVersion valueOfByXmlNamespace(String ns)
Gets a VCardVersion instance based on the given XML namespace.

Parameters:
ns - the XML namespace
Returns:
the object or null if not found

toString

public String toString()
Overrides:
toString in class Enum<VCardVersion>


Copyright © 2012-2014 Michael Angstadt. All Rights Reserved.