Package google.registry.model.eppcommon
Class Address
java.lang.Object
google.registry.model.ImmutableObject
google.registry.model.eppcommon.Address
- All Implemented Interfaces:
Jsonifiable
,UnsafeSerializable
,GsonUtils.GsonPostProcessable
,Serializable
,Cloneable
- Direct Known Subclasses:
ContactAddress
,MarkAddress
,RegistrarAddress
@Embeddable
@MappedSuperclass
public class Address
extends ImmutableObject
implements Jsonifiable, UnsafeSerializable, GsonUtils.GsonPostProcessable
Container for generic street address.
This is the "addrType" type from RFC5733. It also matches the "addrType" type from Mark and Signed Mark Objects Mapping.
- See Also:
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
Address.Builder<T extends Address>
A builder for constructingAddress
.Nested classes/interfaces inherited from class google.registry.model.ImmutableObject
ImmutableObject.DoNotHydrate, ImmutableObject.IgnoredInDiffableMap, ImmutableObject.Insignificant
-
Field Summary
Modifier and TypeFieldDescriptionprotected String
protected String
protected String
At most three lines of addresses parsed from XML elements.protected String
protected String
protected String
protected String
Fields inherited from class google.registry.model.ImmutableObject
hashCode
-
Constructor Summary
-
Method Summary
Methods inherited from class google.registry.model.ImmutableObject
clone, cloneEmptyToNull, createVKey, equals, getSignificantFields, hashCode, toDiffableFieldMap, toHydratedString, toString, toStringHelper
-
Field Details
-
street
At most three lines of addresses parsed from XML elements.This field is used to marshal to/unmarshal from XML elements. When persisting to/from SQL, the next three separate fields are used. Those lines are only used for persistence purpose and should not be directly used in Java.
We need to keep the list and the three fields in sync in all the following scenarios when an entity containing a
Address
is created:- When creating an
Address
directly in java, using theAddress.Builder
: TheAddress.Builder.setStreet(ImmutableList)
sets both the list and the fields. - When unmarshalling from XML: The list will be set based on the content of the XML.
Afterwards,
afterUnmarshal(Unmarshaller, Object)
} will be called to set the fields. - When loading from the database: The fields will be set by the values in SQL. Afterwards,
postLoad()
will be called to set the list.
Schema validation will enforce the 3-line limit.
- When creating an
-
streetLine1
-
streetLine2
-
streetLine3
-
city
-
state
-
zip
-
countryCode
-
-
Constructor Details
-
Address
public Address()
-
-
Method Details
-
getStreet
-
getCity
-
getState
-
getZip
-
getCountryCode
-
toJsonMap
Description copied from interface:Jsonifiable
Returns a JSON representation of this object.The returned value must not return sensitive fields, so that it may be safe to return to the client via an API response.
- Specified by:
toJsonMap
in interfaceJsonifiable
-
asBuilder
-
postProcess
public void postProcess()- Specified by:
postProcess
in interfaceGsonUtils.GsonPostProcessable
-