Class SubPropsUtils


  • public class SubPropsUtils
    extends Object
    • Method Detail

      • subProps

        public static Properties subProps​(Properties props,
                                          String prefix,
                                          boolean removePrefix)
        Return a new java.util.Properties object containing only the properties with given prefix.
        Parameters:
        props - input java.util.Properties
        prefix - prefix for the keys to search
        removePrefix - true in case you want to remove the prefix from keys in the resulting Properties
        Returns:
        resulting java.util.Properties
      • subSortedProps

        public static Properties subSortedProps​(Properties props,
                                                String prefix,
                                                boolean removePrefix)
        Return a new java.util.Properties object containing only the properties with given prefix. The result will be a instance of SortedProperties
        Parameters:
        props - input java.util.Properties
        prefix - prefix for the keys to search
        removePrefix - true in case you want to remove the prefix from keys in the resulting Properties
        Returns:
        resulting java.util.Properties
      • subProps

        public static void subProps​(Properties props,
                                    String prefix,
                                    boolean removePrefix,
                                    Properties subProps)
        Return a new java.util.Properties object containing only the properties with given prefix.
        Parameters:
        props - input java.util.Properties
        prefix - prefix for the keys to search
        removePrefix - true in case you want to remove the prefix from keys in the resulting Properties
        subProps - output java.util.Properties