Class PropertiesKeyExtensions
- java.lang.Object
-
- io.github.astrapi69.resourcebundle.properties.PropertiesKeyExtensions
-
public final class PropertiesKeyExtensions extends java.lang.Object
The classPropertiesKeyExtensions
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 dotstatic java.lang.String
concatenate(java.lang.String[] keyParts, @NonNull PropertiesKeySeperator separator)
Concatenates the given string array to a properties key with the given separatorstatic 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 dotstatic 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 separatorstatic 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 dotstatic java.lang.String[]
getKeyParts(@NonNull java.lang.String propertiesKey, @NonNull PropertiesKeySeperator separator)
Gets the parts of a properties key as a string arraystatic java.util.List<java.lang.String>
getKeyPartsAsList(@NonNull java.lang.String propertiesKey)
Gets the parts of a properties key as liststatic java.util.List<java.lang.String>
getKeyPartsAsList(@NonNull java.lang.String propertiesKey, @NonNull PropertiesKeySeperator separator)
Gets the parts of a properties key as liststatic java.lang.String
getParentPropertiesKey(java.lang.String propertiesKey)
Gets the parent properties key as a stringstatic java.lang.String
getParentPropertiesKey(java.lang.String propertiesKey, @NonNull PropertiesKeySeperator separator)
Gets the parent properties key as a string
-
-
-
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 keyseparator
- 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 keyseparator
- 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 keyseparator
- 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 keyseparator
- 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 keyseparator
- 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
-
-