Class AppConfig


  • public final class AppConfig
    extends java.lang.Object
    Utility class for loading application configuration from an external properties file. On startup, loads config.properties from resources/com/palmer/billingstatementgenerator/properties/ relative to the working directory and registers all entries as system properties, making them available throughout the application via System.getProperty(String).

    If the config file does not exist, default values are used for all settings.

    Example config.properties:

     wfh.sales.tax.rate=0.0825
     
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static java.math.BigDecimal getSalesTaxRate()
      Returns the configured sales tax rate as a BigDecimal.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • getSalesTaxRate

        public static java.math.BigDecimal getSalesTaxRate()
        Returns the configured sales tax rate as a BigDecimal. Reads from the system property wfh.sales.tax.rate, defaulting to 0.00 if not set or if the value cannot be parsed.
        Returns:
        the sales tax rate (e.g. 0.0825 for 8.25%)