|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.anidb.udp.DataField
public class DataField
A data field of an entry of a response or a sub data field of a data field.
Method Summary | |
---|---|
DataField |
getDataFieldAt(int index)
Returns the sub data field on the given index. |
int |
getDataFieldCount()
Returns the count the sub data fields. |
java.lang.String |
getValue()
Returns the value. |
java.lang.Boolean |
getValueAsBoolean()
Returns the value as a Boolean . |
java.lang.Integer |
getValueAsInteger()
Returns the value as an Integer . |
int |
getValueAsIntegerValue()
Returns the value as an integer value. |
java.lang.Long |
getValueAsLong()
Returns the value as a Long . |
long |
getValueAsLongValue()
Returns the value as a long value. |
java.util.List<java.lang.String> |
getValues()
Returns the values. |
java.util.List<java.lang.Integer> |
getValuesAsInteger()
Returns the values as Integer objects. |
java.util.List<java.lang.Long> |
getValuesAsLong()
Returns the values as Long objects. |
boolean |
hasDataFields()
Returns the status if this data field has sub fields. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public java.lang.String getValue()
Returns the value.
If the data field contains more than one value, the values will be returned as one including the seperator characters.
public int getValueAsIntegerValue() throws DataFieldException
DataFieldException
- If the field does not contain a parsable
integer.public java.lang.Integer getValueAsInteger() throws DataFieldException
Integer
.
Integer
.
DataFieldException
- If the field does not contain a parsable
integer.public long getValueAsLongValue() throws DataFieldException
DataFieldException
- If the field does not contain a parsable
long.public java.lang.Long getValueAsLong() throws DataFieldException
Long
.
Long
.
DataFieldException
- If the field does not contain a parsable
long.public java.lang.Boolean getValueAsBoolean() throws DataFieldException
Boolean
.
Boolean
DataFieldException
- If the field does not contain a parsable
long or does not contain one of the following values: 0
or
1
.public java.util.List<java.lang.String> getValues()
Returns the values.
If the data field contains only one value, a list with only one element will be returned.
public java.util.List<java.lang.Integer> getValuesAsInteger() throws DataFieldException
Returns the values as Integer
objects.
If the data field contains only one value, a list with only one element will be returned.
Integer
.
DataFieldException
- If the field does not contain parsable integer
values.public java.util.List<java.lang.Long> getValuesAsLong() throws DataFieldException
Returns the values as Long
objects.
If the data field contains only one value, a list with only one element will be returned.
Long
.
DataFieldException
- If the field does not contain parsable long
values.public boolean hasDataFields()
true
, if this data field has sub fields,
otherwise false
.public int getDataFieldCount()
public DataField getDataFieldAt(int index)
index
- The index.
java.lang.IndexOutOfBoundsException
- If the index is out of bounds.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |