FileDocCategorySizeDatePackage
VCardProperty.javaAPI DocAndroid 5.1 API5183Thu Mar 12 22:22:54 GMT 2015com.android.vcard

VCardProperty

public class VCardProperty extends Object
Represents vCard's property, or logical "one line" of each vCard entry. e.g. Given a vCard below, objects for N:name, TEL:1111111111 are "property". BEGIN:VCARD N:name TEL:1111111111 END:VCARD vCard's property has three elements: name, parameter (or param), and value. Name is the name of each property. Parameter or param is additional information for the property. Value is one or multiple values representing the parameter. e.g. N;CHARSET=UTF-8:Joe;Due;M.;Mr.;Ph.D., has "N" for name, "CHALSET=UTF-8" for param, and "Joe;Due;M.;Mr.;Ph.D." for value. Usually params are represented as "key=value" pair, but not always (The property TEL;WORK;VOICE:(111) 555-1212 has two params without key "TYPE", which are same as "TYPE=WORK" and "TYPE=VOICE". In vCard 3.0, we can even express them as "TYPE=WORK,VOICE"). Sometimes (not always) value can be separated by semi-colon. In the example above "Joe;Due;;;" should be interpreted as five strings: "Joe" (for family name), "Due" (for given name), "M." (for middle name), "Mr." (for prefix), and "Ph.D." (for suffix). Whether the value is separable or not is specified by vCard specs.

Fields Summary
private static final String
LOG_TAG
private String
mName
private List
mGroupList
private Map
mParameterMap
private String
mRawValue
private List
mValueList
private byte[]
mByteValue
Constructors Summary
Methods Summary
public voidaddGroup(java.lang.String group)

        if (mGroupList == null) {
            mGroupList = new ArrayList<String>();
        }
        mGroupList.add(group);
    
public voidaddParameter(java.lang.String paramName, java.lang.String paramValue)

        Collection<String> values;
        if (!mParameterMap.containsKey(paramName)) {
            if (paramName.equals("TYPE")) {
                values = new HashSet<String>();
            } else {
                values = new ArrayList<String>();
            }
            mParameterMap.put(paramName, values);
        } else {
            values = mParameterMap.get(paramName);
        }
        values.add(paramValue);
    
public voidaddValues(java.lang.String propertyValues)

        if (mValueList == null) {
            mValueList = Arrays.asList(propertyValues);
        } else {
            mValueList.addAll(Arrays.asList(propertyValues));
        }
    
public voidaddValues(java.util.List propertyValueList)

        if (mValueList == null) {
            mValueList = new ArrayList<String>(propertyValueList);
        } else {
            mValueList.addAll(propertyValueList);
        }
    
public byte[]getByteValue()

        return mByteValue;
    
public java.util.ListgetGroupList()

        return mGroupList;
    
public java.lang.StringgetName()

        return mName;
    
public java.util.MapgetParameterMap()

        return mParameterMap;
    
public java.util.CollectiongetParameters(java.lang.String type)

        return mParameterMap.get(type);
    
public java.lang.StringgetRawValue()

        return mRawValue;
    
public java.util.ListgetValueList()

        return mValueList;
    
public voidsetByteValue(byte[] byteValue)

        mByteValue = byteValue;
    
public voidsetName(java.lang.String name)


        
        if (mName != null) {
            Log.w(LOG_TAG, String.format("Property name is re-defined " +
                    "(existing: %s, requested: %s", mName, name));
        }
        mName = name;
    
public voidsetParameter(java.lang.String paramName, java.lang.String paramValue)

        mParameterMap.clear();
        addParameter(paramName, paramValue);
    
public voidsetRawValue(java.lang.String rawValue)

        mRawValue = rawValue;
    
public voidsetValues(java.lang.String propertyValues)

        mValueList = Arrays.asList(propertyValues);
    
public voidsetValues(java.util.List propertyValueList)

        mValueList = propertyValueList;