Package com.tccc.kos.core.service.region
Class BaseRegion
java.lang.Object
com.tccc.kos.core.service.region.BaseRegion
Base class for a region.
- Since:
- 1.0
- Version:
- 2023-02-23
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
applyDefaultUpdates
(BeanUpdate updates) Applies the default units, time format, and date format from the specified region to the settings bean via the specified updates object.Returns the ISO 3166 country code for the region.Returns the ID of the default date format used by UI code.getId()
Returns the unique ID for this region.Returns the ID of the default time format used by UI code.Return the list of recommended timezones for the region.Returns the ID of the default unit system used by UI code to interact with units of measure.boolean
Returns true if this is the factory region.boolean
isHidden()
If true, hide the region from the user.void
setCountry
(String country) void
setDateFormatId
(String dateFormatId) void
setHidden
(boolean hidden) void
void
setTimeFormatId
(String timeFormatId) void
setTimeZones
(List<String> timeZones) void
setUnitSystemId
(String unitSystemId) toString()
-
Field Details
-
FACTORY_ID
- See Also:
-
-
Constructor Details
-
BaseRegion
public BaseRegion()
-
-
Method Details
-
getId
Returns the unique ID for this region. This may be a country code or some other ID for the region, depending on the definition of region in a particular application. -
isFactory
public boolean isFactory()Returns true if this is the factory region. The factory region is a special region set during manufacturing which is, effectively, a non-region that can disable functionality that needs regional information, such as regulatory data around nutrition information or RFID frequencies. -
getCountry
Returns the ISO 3166 country code for the region. -
getTimeFormatId
Returns the ID of the default time format used by UI code. -
getDateFormatId
Returns the ID of the default date format used by UI code. -
getUnitSystemId
Returns the ID of the default unit system used by UI code to interact with units of measure. -
getTimeZones
Return the list of recommended timezones for the region. -
isHidden
public boolean isHidden()If true, hide the region from the user. Useful way to obsolete an existing region as it allow the region to remain in the list but it cannot be selected on any new devices. -
applyDefaultUpdates
Applies the default units, time format, and date format from the specified region to the settings bean via the specified updates object. This method simply populates the updates bean with the values from the region. This is called fromRegionService
any time the region is changed so that the defaults from the new region can be applied to the settings.Override to apply additional config changes on region change but call
super.applyDefaultUpdates()
to ensure all updates are applied.- Parameters:
updates
- the updates bean to hold the changes
-
setId
-
setCountry
-
setTimeFormatId
-
setDateFormatId
-
setUnitSystemId
-
setTimeZones
-
setHidden
public void setHidden(boolean hidden) -
toString
-