public class ItemPropValue extends Object
Modifier and Type | Class and Description |
---|---|
static class |
ItemPropValue.Type
Supported types.
|
Constructor and Description |
---|
ItemPropValue(Object content,
ItemPropValue.Type type)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object obj) |
static String |
formatDateTime(Date in) |
Date |
getAsDate() |
float |
getAsFloat() |
int |
getAsInteger() |
URL |
getAsLink() |
ItemScope |
getAsNested() |
Object |
getContent() |
ItemPropValue.Type |
getType() |
int |
hashCode() |
boolean |
isDate() |
boolean |
isFloat() |
boolean |
isInteger() |
boolean |
isLink() |
boolean |
isNested() |
boolean |
isNumber() |
boolean |
isPlain() |
static Date |
parseDateTime(String dateStr) |
String |
toJSON() |
String |
toString() |
public ItemPropValue(Object content, ItemPropValue.Type type)
content
- content object.type
- content type.public static Date parseDateTime(String dateStr) throws ParseException
ParseException
public Object getContent()
public ItemPropValue.Type getType()
public boolean isPlain()
true
if type is plain text.public boolean isLink()
true
if type is a link.public boolean isDate()
true
if type is a date.public boolean isNested()
true
if type is a nested ItemScope
.public boolean isInteger()
true
if type is an integer.public boolean isFloat()
true
if type is a float.public boolean isNumber()
true
if type is a number.public int getAsInteger()
NumberFormatException
- if the content is not an integer.ClassCastException
- if content is not plain.public float getAsFloat()
NumberFormatException
- if the content is not an float.ClassCastException
- if content is not plain.public Date getAsDate()
Date
if type == Type.DateTime
,ClassCastException
- if content is not a valid date.public URL getAsLink()
MalformedURLException
- if the content is not a valid URL.ClassCastException
- if content is not a link.public ItemScope getAsNested()
ItemScope
.ClassCastException
- if the content is not a valid nested item.public String toJSON()
Copyright © 2010-2013 The Apache Software Foundation. All Rights Reserved.