Class SimplePropertyRegistry

    • Constructor Detail

      • SimplePropertyRegistry

        public SimplePropertyRegistry()
        Creates a simple property registry.
    • Method Detail

      • getProperty

        @Nullable
        public String getProperty​(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 String getProperty​(String key,
                                  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.
      • setProperty

        @Nullable
        public String setProperty​(String key,
                                  String value)
        Description copied from interface: PropertyRegistry
        Sets a property that maps a key to a value.
        Specified by:
        setProperty in interface PropertyRegistry
        Parameters:
        key - the key.
        value - the value.
        Returns:
        the previous value of the property, or null if the property is not found.
      • checkPropertyPermission

        protected void checkPropertyPermission​(String key,
                                               String action)
        Checks that an action on a property is permitted.
        Parameters:
        key - the property key.
        action - the action.