Class PropertiesKeyExtensions


  • public final class PropertiesKeyExtensions
    extends java.lang.Object
    The class PropertiesKeyExtensions provides methods for split properties keys to parts and to concatenate properties parts back again
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static java.lang.String concatenate​(java.lang.String[] keyParts)
      Concatenates the given string array to a properties key with the default separator that is a dot
      static java.lang.String concatenate​(java.lang.String[] keyParts, @NonNull PropertiesKeySeperator separator)
      Concatenates the given string array to a properties key with the given separator
      static java.lang.String concatenate​(java.util.List<java.lang.String> keyParts)
      Concatenates the given string list to a properties key with the default separator that is a dot
      static java.lang.String concatenate​(java.util.List<java.lang.String> keyParts, @NonNull PropertiesKeySeperator separator)
      Concatenates the given string list to a properties key with the given separator
      static java.lang.String[] getKeyParts​(@NonNull java.lang.String propertiesKey)
      Gets the parts of a properties key as a string array with the default seperator that is a dot
      static java.lang.String[] getKeyParts​(@NonNull java.lang.String propertiesKey, @NonNull PropertiesKeySeperator separator)
      Gets the parts of a properties key as a string array
      static java.util.List<java.lang.String> getKeyPartsAsList​(@NonNull java.lang.String propertiesKey)
      Gets the parts of a properties key as list
      static java.util.List<java.lang.String> getKeyPartsAsList​(@NonNull java.lang.String propertiesKey, @NonNull PropertiesKeySeperator separator)
      Gets the parts of a properties key as list
      static java.lang.String getParentPropertiesKey​(java.lang.String propertiesKey)
      Gets the parent properties key as a string
      static java.lang.String getParentPropertiesKey​(java.lang.String propertiesKey, @NonNull PropertiesKeySeperator separator)
      Gets the parent properties key as a string
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • getKeyParts

        public static java.lang.String[] getKeyParts​(@NonNull
                                                     @NonNull java.lang.String propertiesKey,
                                                     @NonNull
                                                     @NonNull PropertiesKeySeperator separator)
        Gets the parts of a properties key as a string array
        Parameters:
        propertiesKey - the properties key
        separator - the used separator
        Returns:
        the parts of a properties key as string array
      • getKeyPartsAsList

        public static java.util.List<java.lang.String> getKeyPartsAsList​(@NonNull
                                                                         @NonNull java.lang.String propertiesKey,
                                                                         @NonNull
                                                                         @NonNull PropertiesKeySeperator separator)
        Gets the parts of a properties key as list
        Parameters:
        propertiesKey - the properties key
        separator - the used separator
        Returns:
        the parts of a properties key as list
      • getKeyPartsAsList

        public static java.util.List<java.lang.String> getKeyPartsAsList​(@NonNull
                                                                         @NonNull java.lang.String propertiesKey)
        Gets the parts of a properties key as list
        Parameters:
        propertiesKey - the properties key
        Returns:
        the parts of a properties key as list
      • getKeyParts

        public static java.lang.String[] getKeyParts​(@NonNull
                                                     @NonNull java.lang.String propertiesKey)
        Gets the parts of a properties key as a string array with the default seperator that is a dot
        Parameters:
        propertiesKey - the properties key
        Returns:
        the parts of a properties key as string array
      • getParentPropertiesKey

        public static java.lang.String getParentPropertiesKey​(java.lang.String propertiesKey,
                                                              @NonNull
                                                              @NonNull PropertiesKeySeperator separator)
        Gets the parent properties key as a string
        Parameters:
        propertiesKey - the properties key
        separator - the used separator
        Returns:
        the parts of a properties key as a string
      • getParentPropertiesKey

        public static java.lang.String getParentPropertiesKey​(java.lang.String propertiesKey)
        Gets the parent properties key as a string
        Parameters:
        propertiesKey - the properties key
        Returns:
        the parts of a properties key as a string
      • concatenate

        public static java.lang.String concatenate​(java.lang.String[] keyParts,
                                                   @NonNull
                                                   @NonNull PropertiesKeySeperator separator)
        Concatenates the given string array to a properties key with the given separator
        Parameters:
        keyParts - the key parts of the properties key
        separator - the used separator
        Returns:
        the concatenated properties key
      • concatenate

        public static java.lang.String concatenate​(java.util.List<java.lang.String> keyParts,
                                                   @NonNull
                                                   @NonNull PropertiesKeySeperator separator)
        Concatenates the given string list to a properties key with the given separator
        Parameters:
        keyParts - the key parts of the properties key
        separator - the used separator
        Returns:
        the concatenated properties key
      • concatenate

        public static java.lang.String concatenate​(java.util.List<java.lang.String> keyParts)
        Concatenates the given string list to a properties key with the default separator that is a dot
        Parameters:
        keyParts - the key parts of the properties key
        Returns:
        the concatenated properties key
      • concatenate

        public static java.lang.String concatenate​(java.lang.String[] keyParts)
        Concatenates the given string array to a properties key with the default separator that is a dot
        Parameters:
        keyParts - the key parts of the properties key
        Returns:
        the concatenated properties key