Class PropertiesUtils


  • public class PropertiesUtils
    extends Object
    • Method Detail

      • getChildProperties

        public static Map<String,​String> getChildProperties​(String prefix,
                                                                  @NonNull
                                                                  @NonNull Properties properties)
        Parameters:
        prefix - key prefix to search for
        properties - search source
        Returns:
        all properties entries whose original keys start with the specified prefix. The prefix is removed from the keys of the returned entries.
      • getPropertiesGroupOfType

        public static List<Map<String,​String>> getPropertiesGroupOfType​(String type,
                                                                              @NonNull
                                                                              @NonNull Properties properties)
        Parameters:
        type - the properties value whose keys are each used as a parent key prefix
        properties - search source
        Returns:
        a group whose every member is a set of properties entries having a common key prefix of the specified type
      • getAsInteger

        @Nullable
        public static Integer getAsInteger​(String name,
                                           @NonNull
                                           @NonNull Properties properties)
        Takes only digits from the value to form a sequence, and tries to parse the sequence as an Integer
        Parameters:
        name - full key in properties
        properties - to look up in
        Returns:
        Integer value of the specified name in the given properties, null if named entry missing or the corresponding value contains no digit