Class SubPropsUtils
- java.lang.Object
-
- org.fugerit.java.core.util.collection.SubPropsUtils
-
public class SubPropsUtils extends Object
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static Properties
subProps(Properties props, String prefix, boolean removePrefix)
Return a newjava.util.Properties
object containing only the properties with given prefix.static void
subProps(Properties props, String prefix, boolean removePrefix, Properties subProps)
Return a newjava.util.Properties
object containing only the properties with given prefix.static Properties
subSortedProps(Properties props, String prefix, boolean removePrefix)
Return a newjava.util.Properties
object containing only the properties with given prefix.
-
-
-
Method Detail
-
subProps
public static Properties subProps(Properties props, String prefix, boolean removePrefix)
Return a newjava.util.Properties
object containing only the properties with given prefix.- Parameters:
props
- input java.util.Propertiesprefix
- prefix for the keys to searchremovePrefix
-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 newjava.util.Properties
object containing only the properties with given prefix. The result will be a instance ofSortedProperties
- Parameters:
props
- input java.util.Propertiesprefix
- prefix for the keys to searchremovePrefix
-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 newjava.util.Properties
object containing only the properties with given prefix.- Parameters:
props
- input java.util.Propertiesprefix
- prefix for the keys to searchremovePrefix
-true
in case you want to remove the prefix from keys in the resulting PropertiessubProps
- output java.util.Properties
-
-