ezvcard.parameters
Class VCardParameter

java.lang.Object
  extended by ezvcard.parameters.VCardParameter
Direct Known Subclasses:
CalscaleParameter, EncodingParameter, LevelParameter, TypeParameter, ValueParameter

public class VCardParameter
extends Object

Represents a vCard parameter (aka "sub type") whose values are pre-defined.

Author:
Michael Angstadt

Field Summary
protected  String name
          The name (e.g.
protected  String value
          The value (e.g.
 
Constructor Summary
VCardParameter(String name, String value)
           
 
Method Summary
protected static
<T extends VCardParameter>
Set<T>
all(Class<T> clazz)
          Gets all values that belong to a parameter class
 boolean equals(Object obj)
           
protected static
<T extends VCardParameter>
T
findByValue(String typeValue, Class<T> clazz)
          Searches the static objects of a child class for one that has a certain value.
 String getName()
          Gets the parameter name.
 String getValue()
          Gets the value of the parameter.
 int hashCode()
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

name

protected final String name
The name (e.g. "TYPE").


value

protected final String value
The value (e.g. "home").

Constructor Detail

VCardParameter

public VCardParameter(String name,
                      String value)
Parameters:
name - the name (e.g. "TYPE")
value - the value (e.g. "home")
Method Detail

getName

public String getName()
Gets the parameter name.

Returns:
the parameter name

getValue

public String getValue()
Gets the value of the parameter.

Returns:
the value of the parameter (e.g. "home")

toString

public String toString()
Overrides:
toString in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object

equals

public boolean equals(Object obj)
Overrides:
equals in class Object

findByValue

protected static <T extends VCardParameter> T findByValue(String typeValue,
                                                          Class<T> clazz)
Searches the static objects of a child class for one that has a certain value.

Parameters:
typeValue - the type value to look for
clazz - the child class
Returns:
the object or null if not found

all

protected static <T extends VCardParameter> Set<T> all(Class<T> clazz)
Gets all values that belong to a parameter class

Type Parameters:
T -
Parameters:
clazz - the parameter class
Returns:
all of the parameter's values


Copyright © 2012-2013. All Rights Reserved.