Class BaseRegion

java.lang.Object
com.tccc.kos.core.service.region.BaseRegion

public class BaseRegion extends Object
Base class for a region.
Since:
1.0
Version:
2023-02-23
  • Field Details

  • Constructor Details

    • BaseRegion

      public BaseRegion()
  • Method Details

    • getId

      public String 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

      public String getCountry()
      Returns the ISO 3166 country code for the region.
    • getTimeFormatId

      public String getTimeFormatId()
      Returns the ID of the default time format used by UI code.
    • getDateFormatId

      public String getDateFormatId()
      Returns the ID of the default date format used by UI code.
    • getUnitSystemId

      public String getUnitSystemId()
      Returns the ID of the default unit system used by UI code to interact with units of measure.
    • getTimeZones

      public List<String> 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

      public void 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. This method simply populates the updates bean with the values from the region. This is called from RegionService 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

      public void setId(String id)
    • setCountry

      public void setCountry(String country)
    • setTimeFormatId

      public void setTimeFormatId(String timeFormatId)
    • setDateFormatId

      public void setDateFormatId(String dateFormatId)
    • setUnitSystemId

      public void setUnitSystemId(String unitSystemId)
    • setTimeZones

      public void setTimeZones(List<String> timeZones)
    • setHidden

      public void setHidden(boolean hidden)
    • toString

      public String toString()
      Overrides:
      toString in class Object