Class FilePropertyLoader

  • All Implemented Interfaces:
    PropertyLoader

    public class FilePropertyLoader
    extends java.lang.Object
    implements PropertyLoader
    A property loader that searches in a properties file.
    • Constructor Summary

      Constructors 
      Constructor Description
      FilePropertyLoader​(java.lang.String path)
      Creates a file property loader.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.String getProperty​(java.lang.String key)
      Gets the value mapped with the specified key.
      java.lang.String getProperty​(java.lang.String key, java.lang.String defaultValue)
      Gets the value mapped with the specified key or a default value.
      • Methods inherited from class java.lang.Object

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

      • FilePropertyLoader

        public FilePropertyLoader​(java.lang.String path)
        Creates a file property loader.
        Parameters:
        path - the properties file path.
    • Method Detail

      • getProperty

        @Nullable
        public java.lang.String getProperty​(java.lang.String key)
        Description copied from interface: PropertyLoader
        Gets the value mapped with the specified key.
        Specified by:
        getProperty in interface PropertyLoader
        Parameters:
        key - the key.
        Returns:
        the value of the property, or null if the property is not found.
      • getProperty

        public java.lang.String getProperty​(java.lang.String key,
                                            java.lang.String defaultValue)
        Description copied from interface: PropertyLoader
        Gets the value mapped with the specified key or a default value.
        Specified by:
        getProperty in interface PropertyLoader
        Parameters:
        key - the key.
        defaultValue - the default value.
        Returns:
        the value of the property, or the default value if the property is not found.