public final class CSCountry extends CSItem
The CSCountry
class includes methods for the retrieval of a particular country's details.
All such methods require that certain database and key information (country ID, for example) be specified via the
set
methods provided, prior to their invocation.
All database access/connectivity is handled internally by the CSCountry
class.
CSCountryContent
,
CSCountryMultiple
,
CSState
,
Serialized FormACCESS_GRANTED, DOES_NOT_EXIST, EMPTY, EXISTS, SECURE_ACCESS_DENIED, SECURE_ACCESS_GRANTED, UPDATE_ACTION_INSERTED, UPDATE_ACTION_UPDATED
LEVEL_ALL, LEVEL_ALL_PLUS_RELATED, LEVEL_DETAIL, LEVEL_ID, LEVEL_SUMMARY
Constructor and Description |
---|
CSCountry()
Creates an empty
CSCountry object. |
CSCountry(CSCountry objItem)
Creates an empty
CSCountry object, and initialises it from the contents of the supplied CSItem
object. |
CSCountry(java.lang.String strPropertyFile)
Creates a new
CSCountry , specifying a property file that contains all of the database connection
details. |
Modifier and Type | Method and Description |
---|---|
void |
delete()
Not currently implemented for
CSCountry . |
boolean |
exist()
Determines whether a country exists on the database.
|
void |
get()
Retrieves the details of a country from the database.
|
java.lang.String |
getAbbrevThree()
Gets the three character abbreviation of the country.
|
java.lang.String |
getAbbrevTwo()
Gets the two character abbreviation of the country.
|
int |
getCountryNumber()
Gets the number of the country to be used as key information.
|
java.lang.String |
getCurrencyCodeAlpha()
Gets the three character currency code of the country.
|
java.lang.Integer |
getCurrencyCodeNumeric()
Gets the numeric currency code of the country.
|
java.lang.Integer |
getCurrencyMinorDecimalPlaces()
Gets the number of decimals places used to indicate the minor currency unit of the country, for example Pence.
|
java.lang.String |
getCurrencyName()
Gets the currency name of the country.
|
java.lang.String |
getCurrencySymbol()
Gets the currency symbol of the country.
|
java.lang.String |
getEnglishName()
Gets the name of the country in English.
|
java.lang.Double |
getExchangeRate()
Gets the exchange rate to be used to convert prices held on the database into the equivalent price for the
country.
|
java.lang.String |
getFrenchName()
Gets the name of the country in French.
|
java.lang.String |
getGermanName()
Gets the name of the country in German.
|
java.lang.String |
getName()
Gets the official name of the country.
|
void |
setAbbrevThree(java.lang.String strAbbrevThree)
Sets the three character abbreviation of the country.
|
void |
setAbbrevTwo(java.lang.String strAbbrevTwo)
Sets the two character abbreviation of the country.
|
void |
setCountryNumber(int nCountryNumber)
Sets the number of the country to be used as key information.
|
void |
setCurrencyCodeAlpha(java.lang.String strCurrencyCodeAlpha)
Sets the three character currency code of the country.
|
void |
setCurrencyCodeNumeric(java.lang.Integer nCurrencyCodeNumeric)
Sets the numeric currency code of the country.
|
void |
setCurrencyMinorDecimalPlaces(java.lang.Integer nDecimalPlaces)
Sets the number of decimals places used to indicate the minor currency unit of the country, for example Pence.
|
void |
setCurrencyName(java.lang.String strCurrencyName)
Sets the currency name of the country.
|
void |
setCurrencySymbol(java.lang.String strCurrencySymbol)
Sets the currency symbol of the country.
|
void |
setDetailLevel(int nDetailLevel)
Sets the level of detail to be handled by the
get method. |
void |
setEnglishName(java.lang.String strEnglishName)
Sets the name of the country in English.
|
void |
setExchangeRate(java.lang.Double nExchangeRate)
Sets the exchange rate to be used to convert prices held on the database into the equivalent price for the
country.
|
void |
setFrenchName(java.lang.String strFrenchName)
Sets the name of the country in French.
|
void |
setGermanName(java.lang.String strGermanName)
Sets the name of the country in German.
|
void |
setName(java.lang.String strName)
Sets the official name of the country.
|
void |
update()
Not currently implemented for
CSCountry . |
equals, getID, getStatus, hashCode, jsonString, serialiseWithTypes, setID, setStatus, toString, unset
clearRecordedGatewayMessages, clone, count, getCache, getCachingEnabled, getDatabaseVersion, getDatabaseVersion, getDebugOutput, getDetailLevel, getPreview, getPropertyFile, getPropertyFileExtension, getPropertyFilePathname, getRecordedGatewayMessages, getRecordGatewayMessages, getSendGatewayMessages, getUseCache, setDebugOutput, setPreview, setPropertyFile, setRecordGatewayMessages, setSendGatewayMessages, setUseCache
public CSCountry()
CSCountry
object.
Use the various set methods provided to initialise the CSCountry
object prior to invoking any of
its query methods.
public CSCountry(CSCountry objItem)
CSCountry
object, and initialises it from the contents of the supplied CSItem
object.
objItem
- the CSCountry
object to be used to initialise the new onepublic CSCountry(java.lang.String strPropertyFile)
CSCountry
, specifying a property file that contains all of the database connection
details.
Use the various set methods provided to initialise the CSCountry
object prior to invoking any of
its query methods.
strPropertyFile
- the property file that contains the connection details.public int getCountryNumber()
public void setCountryNumber(int nCountryNumber)
setCountryNumber
followed by a call to get
will return details of the country with
the specified number.
nCountryNumber
- the country's number to be used as key information.public java.lang.String getAbbrevTwo()
public void setAbbrevTwo(java.lang.String strAbbrevTwo)
strAbbrevTwo
- the country's two character abbreviation.public java.lang.String getAbbrevThree()
public void setAbbrevThree(java.lang.String strAbbrevThree)
strAbbrevThree
- the country's three character abbreviation.public java.lang.String getName()
public void setName(java.lang.String strName)
strName
- the country's official name.public java.lang.String getEnglishName()
public void setEnglishName(java.lang.String strEnglishName)
strEnglishName
- the country's name in English.public java.lang.String getFrenchName()
public void setFrenchName(java.lang.String strFrenchName)
strFrenchName
- the country's name in French.public java.lang.String getGermanName()
public void setGermanName(java.lang.String strGermanName)
strGermanName
- the country's name in German.public java.lang.String getCurrencySymbol()
public void setCurrencySymbol(java.lang.String strCurrencySymbol)
strCurrencySymbol
- the country's currency symbol.public java.lang.String getCurrencyName()
public void setCurrencyName(java.lang.String strCurrencyName)
strCurrencyName
- the country's currency name.public java.lang.String getCurrencyCodeAlpha()
public void setCurrencyCodeAlpha(java.lang.String strCurrencyCodeAlpha)
strCurrencyCodeAlpha
- the country's three character currency code.public java.lang.Integer getCurrencyCodeNumeric()
public void setCurrencyCodeNumeric(java.lang.Integer nCurrencyCodeNumeric)
nCurrencyCodeNumeric
- the country's numeric currency code.public java.lang.Integer getCurrencyMinorDecimalPlaces()
public void setCurrencyMinorDecimalPlaces(java.lang.Integer nDecimalPlaces)
nDecimalPlaces
- the decimal places of the country's minor currency unit.public java.lang.Double getExchangeRate()
public void setExchangeRate(java.lang.Double nExchangeRate)
nExchangeRate
- the country's exchange rate.public void setDetailLevel(int nDetailLevel) throws CSParameterException
get
method. Default is LEVEL_ALL.
Valid detail levels for a country are :
LEVEL_ID
Retrieves the CountryNumber.LEVEL_SUMMARY
Retrieves the CountryName.LEVEL_DETAIL
Retrieves the AbbrevTwo, AbbrevThree, CurrencySymbol, CurrencyName,
CurrencyCodeAlpha, CurrencyCodeNumeric, CurrencyMinorDecimalPlaces, ExchangeRate.LEVEL_ALL
Retrieves all country data.setDetailLevel
in class CSDatabaseItem
nDetailLevel
- the detail level to be used.CSParameterException
- if an invalid detail level is specified.public boolean exist() throws CSException
Use setCountryNumber
followed by exist
to ascertain if there is a
country with the specified number on the database.
Use setName
followed by exist
to ascertain if there is a country with the
specified official name on the database.
exist
in class CSItem
true
if this country exists on the database.CSParameterException
- if an invalid combination of key information has been supplied.CSDatabaseException
- if there are problems accessing the database.CSSecurityException
- if security has been breached.CSException
- the base class for exceptions thrown by this method.public void get() throws CSException
If it is not necessary to retrieve all the details of the country then specify the amount of detail required
using the setDetailLevel
method before calling this method.
Use setCountryNumber
followed by get
to populate this
CSCountry
object with the details of the country identified by the specified number.
Use setName
followed by get
to populate this CSCountry
object with the details of the country identified by the specified official name.
get
in class CSItem
CSParameterException
- if an invalid combination of key information has been supplied.CSDatabaseException
- if there are problems accessing the database.CSNotFoundException
- if the specified country cannot be found on the database.CSSecurityException
- if security has been breached.CSException
- the base class for exceptions thrown by this method.public void update() throws CSException
CSCountry
.
update
in class CSItem
CSParameterException
- if an invalid combination of key information has been supplied.CSDatabaseException
- if there are problems accessing the database.CSNotFoundException
- if one of the specified countries cannot be found on the database.CSException
- the base class for exceptions thrown by this method.public void delete() throws CSException
CSCountry
.
delete
in class CSItem
CSParameterException
- if an invalid combination of key information has been supplied.CSDatabaseException
- if there are problems accessing the database.CSNotFoundException
- if one of the specified countries cannot be found on the database.CSException
- the base class for exceptions thrown by this method.Copyright © 2022 Goss Interactive Ltd. All Rights Reserved.