net.anidb.udp
Class UdpResponseDataField

java.lang.Object
  extended by net.anidb.udp.UdpResponseDataField

public class UdpResponseDataField
extends java.lang.Object

A data field of an entry of a response.

Version:
1.0, 29.11.2009
Author:
grizzlyxp (http://anidb.net/perl-bin/animedb.pl?show=userpage&uid=63935)

Method Summary
 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.
 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.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getValue

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.

Returns:
The value.

getValueAsInteger

public java.lang.Integer getValueAsInteger()
                                    throws DataFieldException
Returns the value as an Integer.

Returns:
The Integer.
Throws:
DataFieldException - If the field does not contain a parsable integer.

getValueAsLongValue

public long getValueAsLongValue()
                         throws DataFieldException
Returns the value as a long value.

Returns:
The long value.
Throws:
DataFieldException - If the field does not contain a parsable long.

getValueAsLong

public java.lang.Long getValueAsLong()
                              throws DataFieldException
Returns the value as a Long.

Returns:
The Long.
Throws:
DataFieldException - If the field does not contain a parsable long.

getValueAsBoolean

public java.lang.Boolean getValueAsBoolean()
                                    throws DataFieldException
Returns the value as a Boolean.

Returns:
The Boolean
Throws:
DataFieldException - If the field does not contain a parsable long or does not contain one of the following values: 0 or 1.

getValues

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.

Returns:
The values.

getValuesAsInteger

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.

Returns:
The values of class Integer.
Throws:
DataFieldException - If the field does not contain parsable integer values.

getValuesAsLong

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.

Returns:
The values of class Long.
Throws:
DataFieldException - If the field does not contain parsable long values.