ezvcard.io.json
Class JCardValue

java.lang.Object
  extended by ezvcard.io.json.JCardValue

public class JCardValue
extends Object

Holds the data type and value of a jCard property.

Author:
Michael Angstadt

Constructor Summary
JCardValue(JsonValue... values)
          Creates a new jCard value.
JCardValue(List<JsonValue> values)
          Creates a new jCard value.
 
Method Summary
 List<String> asMulti()
          Gets the value of a multi-valued property (such as Categories ).
 String asSingle()
          Gets the value of a single-valued property (such as Note).
 List<List<String>> asStructured()
          Gets the value of a structured property (such as StructuredName).
 List<JsonValue> getValues()
          Gets all the JSON values.
static JCardValue multi(List<?> values)
          Creates a multi-valued value.
static JCardValue multi(Object... values)
          Creates a multi-valued value.
static JCardValue single(Object value)
          Creates a single-valued value.
static JCardValue structured(List<List<?>> values)
          Creates a structured value.
static JCardValue structured(Object... values)
           Creates a structured value.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JCardValue

public JCardValue(List<JsonValue> values)
Creates a new jCard value.

Parameters:
values - the values

JCardValue

public JCardValue(JsonValue... values)
Creates a new jCard value.

Parameters:
values - the values
Method Detail

single

public static JCardValue single(Object value)
Creates a single-valued value.

Parameters:
value - the value
Returns:
the jCard value

multi

public static JCardValue multi(Object... values)
Creates a multi-valued value.

Parameters:
values - the values
Returns:
the jCard value

multi

public static JCardValue multi(List<?> values)
Creates a multi-valued value.

Parameters:
values - the values
Returns:
the jCard value

structured

public static JCardValue structured(Object... values)

Creates a structured value.

This method accepts a vararg of Object instances. List objects will be treated as multi-valued components. Null objects will be treated as empty components.

Parameters:
values - the values
Returns:
the jCard value

structured

public static JCardValue structured(List<List<?>> values)
Creates a structured value.

Parameters:
values - the values
Returns:
the jCard value

getValues

public List<JsonValue> getValues()
Gets all the JSON values.

Returns:
the JSON values

asSingle

public String asSingle()
Gets the value of a single-valued property (such as Note).

Returns:
the value or empty string if not found

asStructured

public List<List<String>> asStructured()
Gets the value of a structured property (such as StructuredName).

Returns:
the values or empty list if not found

asMulti

public List<String> asMulti()
Gets the value of a multi-valued property (such as Categories ).

Returns:
the values or empty list if not found


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