public class AllowedCharacters extends Object
| Modifier and Type | Class and Description |
|---|---|
static class |
AllowedCharacters.Builder
Builder class for creating new instances of
AllowedCharacters. |
| Constructor and Description |
|---|
AllowedCharacters(BitSet bitSet,
boolean allowNonAscii)
Creates an allowed character list based on the given
BitSet. |
| Modifier and Type | Method and Description |
|---|---|
BitSet |
bitSet()
Gets the underlying
BitSet object. |
boolean |
check(String string)
Determines if a string only contains allowed characters.
|
AllowedCharacters |
flip()
Returns an allowed character list that is the opposite of this allowed
character list (in other words, characters that are NOT allowed).
|
boolean |
isNonAsciiAllowed()
Determines if this allowed character list permits characters that are not
part of 7-bit ASCII (character codes greater than 127).
|
String |
toString()
Generates a string representation of this allowed character list.
|
String |
toString(boolean printableOnly)
Generates a string representation of this allowed character list.
|
public AllowedCharacters(BitSet bitSet, boolean allowNonAscii)
BitSet.bitSet - the bit setallowNonAscii - true to allow characters outside of the 7-bit ASCII
character set (character codes greater than 127), false to only allow
7-bit ASCIIpublic boolean isNonAsciiAllowed()
public boolean check(String string)
string - the stringpublic AllowedCharacters flip()
public String toString()
public String toString(boolean printableOnly)
printableOnly - true to only include printable characters in the
string, false to include all charactersCopyright © 2016–2018 Michael Angstadt. All rights reserved.