CUtilNormalize

This class is used for converting strings.

normalize

This method converts strings so that they can be easily compared.

Strings are converted as follows:

  • "Jim" becomes "jim"
  • "Jim " becomes "jim"
  • " Jim " becomes "jim"
  • "J-i_m" becomes "jim"
  • " J\ni\\m\r\t" becomes "jim"
  • "äüöß" becomes "aeueoess"
  • ".;." becomes ".."
@NotNull
public static String normalize(@Nullable final String aKey);

normalizePreference

This class works similarly. It simplifies strings that are used for storing configurations.

  • "nodeid" remains "nodeid"
  • "node.id" remains "node.id"
  • "nodeId" becomes "node.id"
  • "NODE_ID" becomes "node.id"
  • "node_id" becomes "node.id"
  • "node-id" becomes "node.id"
@NotNull
public static String normalizePreference(@Nullable final String aKey);

equals

This method calls the normalize() method for a comparison of strings beforehand.

public static boolean equals(@Nullable final String aString1,
                             @Nullable final String aString2);