Package com.storedobject.common
Class GBAddress
java.lang.Object
com.storedobject.common.Address
com.storedobject.common.GBAddress
Represents an address specific to Great Britain with additional functionality
for handling British postal codes and post towns. This class extends the
Address class to provide GB-specific implementation details.
- Author:
- Syam
-
Method Summary
Modifier and TypeMethodDescriptionGet the caption for the "area" line.intGet the number of extra lines.Get the caption for the Postal Code.intWhat is the maximum length of the postal code?intWhat is the minimum length of the postal code?Retrieves the post town from the address lines.booleanWhether the postal code is numeric or not.voidsetPostTown(String postTown) Sets the post town for the address.Methods inherited from class com.storedobject.common.Address
arrangeLines, check, check, copy, create, create, encode, getApartmentName, getAreaName, getBuildingName, getCountry, getHouseName, getLine, getOfficeName, getPOBox, getPOBoxName, getPostalCode, getStreetName, getType, getTypeValue, getTypeValue, getTypeValues, getVillaName, isPOBoxAddress, isPostalCodeAddress, isPostalCodeMandatory, isValid, poBoxPrefix, poBoxSuffix, setApartmentName, setAreaName, setBuildingName, setHouseName, setLine, setOfficeName, setPOBox, setPostalCode, setStreetName, setType, setVillaName, toString, toString, validate
-
Method Details
-
getPostalCodeMaxLength
public int getPostalCodeMaxLength()Description copied from class:AddressWhat is the maximum length of the postal code?- Overrides:
getPostalCodeMaxLengthin classAddress- Returns:
- Maximum required length of the postal code.
-
getPostalCodeMinLength
public int getPostalCodeMinLength()Description copied from class:AddressWhat is the minimum length of the postal code?- Overrides:
getPostalCodeMinLengthin classAddress- Returns:
- Minimum required length of the postal code.
-
getExtraLines
public int getExtraLines()Description copied from class:AddressGet the number of extra lines.- Overrides:
getExtraLinesin classAddress- Returns:
- Number of extra lines in the address.
-
getPostTown
Retrieves the post town from the address lines. The post town is a specific required component of postal addresses in Great Britain.- Returns:
- the name of the post town as a String. If the post town is not defined, an empty string is returned.
-
setPostTown
Sets the post town for the address. The post town is converted to uppercase and any leading or trailing whitespace is trimmed before being assigned.- Parameters:
postTown- the name of the post town to be set. This should not be null or blank.
-
getPostalCodeCaption
Description copied from class:AddressGet the caption for the Postal Code.- Overrides:
getPostalCodeCaptionin classAddress- Returns:
- Default implementation returns "Postal Code".
-
isNumericPostalCode
public boolean isNumericPostalCode()Description copied from class:AddressWhether the postal code is numeric or not.- Overrides:
isNumericPostalCodein classAddress- Returns:
- True if numeric. False if alpha-numeric.
-
getAreaCaption
Description copied from class:AddressGet the caption for the "area" line.- Overrides:
getAreaCaptionin classAddress- Returns:
- Default implementation returns "Area".
-