Class KeyUtils
java.lang.Object
com.tchristofferson.configupdater.KeyUtils
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic StringgetIndents(String key, char separator) Gets the amount of indentation spaces for the provided key.static booleanisSubKeyOf(String parentKey, String subKey, char separator) Checks if the subKey is a sub path of the parentKey.
-
Constructor Details
-
KeyUtils
public KeyUtils()
-
-
Method Details
-
isSubKeyOf
Checks if the subKey is a sub path of the parentKey.- Parameters:
parentKey- the parent key to check against.subKey- the part of the key to check if it is a sub path of the parent key.separator- the separator between each part of the key. The default is a dot.- Returns:
- true if the subKey is a sub path of the parentKey; returns false if the parentKey is empty or does not contain the subKey.
-
getIndents
Gets the amount of indentation spaces for the provided key.- Parameters:
key- the key to check for the amount of indentation spaces.separator- the separator used in the nested path. The default separator is a dot.- Returns:
- a string contains only the amount of indentation spaces to add.
-