/** * Assert that <code>text</code> is concealed */ public static void concealed(String text) { isTrue(Str.isConcealed(text), "text must be concealed"); }
/** * Assert that <code>text</code> is not concealed */ public static void notConcealed(String text) { isFalse(Str.isConcealed(text), "text is already concealed"); }
/** * Reveal the original contents of a string concealed by the <code>conceal</code> method. * * @see conceal */ public static final String reveal(String text) { if (text == null) { return null; } Assert.noBlanks(text); if (!isConcealed(text)) { return text; } Assert.concealed(text); String substring = removePrefix(text, CONCEALED_PREFIX); char[] chars = substring.toCharArray(); StringBuilder sb = new StringBuilder(); for (char c : chars) { sb.append(Ascii.flip(c)); } return sb.toString(); }
if (isConcealed(text)) { return text;