com.verisign.epp.codec.suggestion
Class EPPSuggestionCoordinates

java.lang.Object
  extended by com.verisign.epp.codec.suggestion.EPPSuggestionCoordinates
All Implemented Interfaces:
EPPCodecComponent, java.io.Serializable, java.lang.Cloneable

public class EPPSuggestionCoordinates
extends java.lang.Object
implements EPPCodecComponent

A Coordinates with latitude and longitude as Double. This is used for geolocation suggestions.

Author:
vraemy
See Also:
Serialized Form

Constructor Summary
EPPSuggestionCoordinates()
          Constructor.
EPPSuggestionCoordinates(double aLat, double aLng)
          Constructor.
EPPSuggestionCoordinates(org.w3c.dom.Element aElement)
          Constructor.
 
Method Summary
 java.lang.Object clone()
          clone an EPPCodecComponent.
 void decode(org.w3c.dom.Element aElement)
          decode a DOM element tree to initialize the instance attributes.
 org.w3c.dom.Element encode(org.w3c.dom.Document aDocument)
          encode instance into a DOM element tree.
 boolean equals(java.lang.Object o)
           
 java.lang.Double getLat()
          Latitude Getter.
 java.lang.Double getLng()
          Longitude getter.
 void setLat(java.lang.Double aLat)
          Latitude setter.
 void setLat(java.lang.String aLatAsString)
          Latitude setter.
 void setLng(java.lang.Double aLng)
          Longitude setter.
 void setLng(java.lang.String aLngAsString)
          Longitude setter.
 java.lang.String toLogString()
          Coordinates as string for log purpose.
 java.lang.String toString()
          Implementation of Object.toString, which will result in an indented XML String representation of the concrete EPPCodecComponent.
 
Methods inherited from class java.lang.Object
finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

EPPSuggestionCoordinates

public EPPSuggestionCoordinates()
Constructor.


EPPSuggestionCoordinates

public EPPSuggestionCoordinates(org.w3c.dom.Element aElement)
                         throws EPPDecodeException
Constructor.

Parameters:
aElement - a dom element
Throws:
EPPDecodeException

EPPSuggestionCoordinates

public EPPSuggestionCoordinates(double aLat,
                                double aLng)
                         throws InvalidValueException
Constructor.

Parameters:
aLat - a latitude
aLng - a longitude
Throws:
InvalidValueException
Method Detail

getLat

public java.lang.Double getLat()
Latitude Getter.

Returns:
a latitude

getLng

public java.lang.Double getLng()
Longitude getter.

Returns:
a longitude

setLat

public void setLat(java.lang.Double aLat)
Latitude setter.

Parameters:
aLat - a latitude

setLng

public void setLng(java.lang.Double aLng)
Longitude setter.

Parameters:
aLng - a longitude

setLat

public void setLat(java.lang.String aLatAsString)
Latitude setter.

Parameters:
aLatAsString - a latitude as string

setLng

public void setLng(java.lang.String aLngAsString)
Longitude setter.

Parameters:
aLngAsString - a longitude as string

toLogString

public java.lang.String toLogString()
Coordinates as string for log purpose.

Returns:
a string

clone

public java.lang.Object clone()
                       throws java.lang.CloneNotSupportedException
Description copied from interface: EPPCodecComponent
clone an EPPCodecComponent.

Specified by:
clone in interface EPPCodecComponent
Overrides:
clone in class java.lang.Object
Returns:
clone of concrete EPPCodecComponent
Throws:
java.lang.CloneNotSupportedException - standard Object.clone exception

decode

public void decode(org.w3c.dom.Element aElement)
            throws EPPDecodeException
Description copied from interface: EPPCodecComponent
decode a DOM element tree to initialize the instance attributes. The aElement argument represents the root DOM element and is used to traverse the DOM nodes for instance attribute values.

For example, the <command> element of EPPCommand is passed into decode of EPPCommand to be decoded and used to set the instance attributes.

Specified by:
decode in interface EPPCodecComponent
Parameters:
aElement - root DOM element associated with instance
Throws:
EPPDecodeException - Error decoding the DOM element tree.

encode

public org.w3c.dom.Element encode(org.w3c.dom.Document aDocument)
                           throws EPPEncodeException
Description copied from interface: EPPCodecComponent
encode instance into a DOM element tree. A DOM Document is passed as an argument and functions as a factory for DOM objects. The root element associated with the instance is created and each instance attribute is appended as a child node.

For example, the <command> element of EPPCommand is created and is used to append the attribute nodes of EPPCommand.

Specified by:
encode in interface EPPCodecComponent
Parameters:
aDocument - DOM document used as a factory of DOM objects.
Returns:
instance root DOM element along with attribute child nodes.
Throws:
EPPEncodeException - Error encoding the DOM element tree.

equals

public boolean equals(java.lang.Object o)
Overrides:
equals in class java.lang.Object

toString

public java.lang.String toString()
Implementation of Object.toString, which will result in an indented XML String representation of the concrete EPPCodecComponent.

Overrides:
toString in class java.lang.Object
Returns:
Indented XML String if successful; ERROR otherwise.


Copyright © VeriSign Inc. All Rights Reserved.