Class GamePropertyUtility


  • @Service
    public class GamePropertyUtility
    extends java.lang.Object
    Utility class to encapsulate the access to the game properties.
    Author:
    Andi Hotz, (c) Sahits GmbH, 2013 Created on Jan 17, 2013
    • Constructor Summary

      Constructors 
      Constructor Description
      GamePropertyUtility()
      Default constructor initializing the properties.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void addSpringProfile​(java.lang.String springProfile)
      Add a spring profile to the active profile list of the system properties.
      private java.util.Properties createDefaultProperties()
      Create a property instance with default values
      java.util.Properties getProperties()
      Retrieve the loaded properties.
      private java.io.File getPropertyFile()  
      private void init()  
      void loadProperties()
      Load the properties from the configuration directory.
      void persistProperties()
      Store the Properties to file.
      • Methods inherited from class java.lang.Object

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

      • props

        private java.util.Properties props
    • Constructor Detail

      • GamePropertyUtility

        public GamePropertyUtility()
        Default constructor initializing the properties.
    • Method Detail

      • init

        private void init()
      • getPropertyFile

        private java.io.File getPropertyFile()
      • loadProperties

        public void loadProperties()
        Load the properties from the configuration directory.
      • getProperties

        public java.util.Properties getProperties()
        Retrieve the loaded properties.
        Returns:
        Properties
      • persistProperties

        public void persistProperties()
        Store the Properties to file.
      • createDefaultProperties

        private java.util.Properties createDefaultProperties()
        Create a property instance with default values
        Returns:
        default Properties
      • addSpringProfile

        public void addSpringProfile​(java.lang.String springProfile)
        Add a spring profile to the active profile list of the system properties.
        Parameters:
        springProfile - name of the profile.