Class MProperties

    • Constructor Detail

      • MProperties

        public MProperties()
      • MProperties

        public MProperties​(String... values)
      • MProperties

        public MProperties​(Dictionary<?,​?> config)
      • MProperties

        public MProperties​(Map<?,​?> in)
      • MProperties

        public MProperties​(Properties properties)
    • Method Detail

      • explodeToOptions

        public static MProperties explodeToOptions​(String properties)
        This will handle the strings like options. Means a string without separator will handled as key and set to true. e.g. val1&val2&a=b will be val1=true, val2=true, a=b
        Parameters:
        properties - Rfc1738 (Url Encode) encoded string
        Returns:
        The MProperties
      • explodeToOptions

        public static MProperties explodeToOptions​(String[] properties)
        This will handle the strings like options. Means a string without separator will handled as key and set to true. e.g. [val1, val2, a=b] will be val1=true, val2=true, a=b
        Parameters:
        properties -
        Returns:
        The MProperties
      • explodeToMProperties

        public static MProperties explodeToMProperties​(String properties)
        This will handle the strings like properties. Means a string without separator will be stored as value with an increasing key as integer, e.g. val1&val2&a=b will be 0=val1, 1=val2, a=b
        Parameters:
        properties - Rfc1738 (Url Encoded) encoded string
        Returns:
        The MProperties
      • explodeToMProperties

        public static MProperties explodeToMProperties​(String[] properties)
        This will handle the strings like properties. Means a string without separator will be stored as value with an increasing key as integer, e.g. [val1, val2, a=b] will be 0=val1, 1=val2, a=b
        Parameters:
        properties -
        Returns:
        The MProperties
      • explodeToMProperties

        public static MProperties explodeToMProperties​(String[] properties,
                                                       int offset,
                                                       int length)
      • explodeToOptions

        public static MProperties explodeToOptions​(String[] properties,
                                                   char separator)
        This will handle the strings like options. Means a string without separator will handled as key and set to true. e.g. [val1, val2, a=b] will be val1=true, val2=true, a=b
        Parameters:
        properties -
        separator -
        Returns:
        The MProperties
      • explodeToMProperties

        public static MProperties explodeToMProperties​(String[] properties,
                                                       char keySeparator,
                                                       char typeSeparator)
        This will handle the strings like properties. Means a string without separator will be stored as value with an increasing key as integer, e.g. [val1, val2, a=b] will be 0=val1, 1=val2, a=b
        Parameters:
        properties -
        keySeparator -
        typeSeparator -
        Returns:
        The MProperties
      • explodeToMProperties

        public static MProperties explodeToMProperties​(String[] properties,
                                                       char keySeparator,
                                                       char typeSeparator,
                                                       int offset,
                                                       int length)
      • explodeToProperties

        public static Properties explodeToProperties​(String[] properties)
        This will handle the strings like properties. Means a string without separator will be stored as value with an increasing key as integer, e.g. [val1, val2, a=b] will be 0=val1, 1=val2, a=b
        Parameters:
        properties -
        Returns:
        The Properties
      • putAll

        public void putAll​(String prefix,
                           Map<?,​?> map)
      • updateFunctional

        public static void updateFunctional​(Map<String,​Object> in)
        In this scenario we separate between functional parameters (starting with one underscore) and data. Using this method functional parameters can be cascaded over multiple levels. Will remove all parameters starting with underscore and not two underscore and remove one underscore from thoos with more underscores. _test will be removed __test will be _test after update
        Parameters:
        in -
      • isFunctional

        public static boolean isFunctional​(String key)
        Return true if key starts with underscore but not with two underscores.
        Parameters:
        key -
        Returns:
        true if actual internal
      • appendToMap

        public static void appendToMap​(Map<?,​?> p,
                                       String para)
      • appendToMap

        public static void appendToMap​(Map<?,​?> p,
                                       String para,
                                       char keySeparator,
                                       char typeSeparator)