code: public static boolean containsOnly(String str, String validChars) {
        if (str == null || validChars == null) {
            return false;
        }
        return containsOnly(str, validChars.toCharArray());
    }
docs: <p>Checks if the String contains only certain characters.</p>
  
  <p>A <code>null</code> String will return <code>false</code>.
  A <code>null</code> valid character String will return <code>false</code>.
  An empty String ("") always returns <code>true</code>.</p>
  
  <pre>
  GosuStringUtil.containsOnly(null, *)       = false
  GosuStringUtil.containsOnly(*, null)       = false
  GosuStringUtil.containsOnly("", *)         = true
  GosuStringUtil.containsOnly("ab", "")      = false
  GosuStringUtil.containsOnly("abab", "abc") = true
  GosuStringUtil.containsOnly("ab1", "abc")  = false
  GosuStringUtil.containsOnly("abz", "abc")  = false
  </pre>
  
  @param str  the String to check, may be null
  @param validChars  a String of valid chars, may be null
  @return true if it only contains valid chars and is non-null
  @since 2.0