Class MsPropertiesAPI


  • public class MsPropertiesAPI
    extends ASubAPI
    API for accessing properties of the properties file on the master server.
    Since:
    8.0.0
    Author:
    XIMA Media GmbH
    • Constructor Detail

      • MsPropertiesAPI

        public MsPropertiesAPI()
    • Method Detail

      • getByKey

        public Optional<Object> getByKey​(String fileName,
                                         String key)
        Gets an optional of the property with the given key in the properties file with the given file name.
        Parameters:
        fileName - of the properties file.
        key - of the property within the properties file.
        Returns:
        An empty Optional if the property has not been set & an optional with the property value if it has been set.
      • getByKeys

        public Map<String,​Optional<Object>> getByKeys​(String fileName,
                                                            Set<String> keys)
        Gets all the properties that have keys that are contained within the given key set from the properties file with the given file name.
        Parameters:
        fileName - of the properties file.
        keys - Set of all the property keys.
        Returns:
        A map with all properties values. Each property value may be empty if it has not been set.
      • getByKeyPrefix

        public Map<String,​Object> getByKeyPrefix​(String fileName,
                                                       String keyPrefix)
        Gets all the properties that have keys that start with the given prefix from the properties file with the given file name.
        Parameters:
        fileName - of the properties file.
        keyPrefix - prefix of the property keys.
        Returns:
        A map with all matching properties values.