Class KeyUtils

java.lang.Object
com.tchristofferson.configupdater.KeyUtils

public class KeyUtils extends Object
  • Constructor Details

    • KeyUtils

      public KeyUtils()
  • Method Details

    • isSubKeyOf

      public static boolean isSubKeyOf(String parentKey, String subKey, char separator)
      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

      public static String getIndents(String key, char separator)
      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.