public interface Characters
Modifier and Type | Interface and Description |
---|---|
static class |
Characters.Any
Defines the set of all printable characters.
|
static class |
Characters.Ascii
Defines the set of all printable ASCII characters.
|
static class |
Characters.Base
Base class for
Characters implementations. |
static class |
Characters.CookieValue
Defines the set of characters allowed in an HTTP cookie value.
|
static class |
Characters.Token
Defines the set of characters allowed in an HTTP token.
|
Modifier and Type | Field and Description |
---|---|
static Characters.Any |
ANY |
static Characters.Ascii |
ASCII |
static Characters.CookieValue |
COOKIE_VALUE |
static Characters.Token |
TOKEN |
Modifier and Type | Method and Description |
---|---|
boolean |
allowed(char c)
Returns true if and only if the given character is allowed.
|
default boolean |
allowed(String value)
Returns true if and only if every character in the given string is allowed.
|
static Characters |
delimited(Characters chars,
char delimiter)
Returns a
Characters that with the same allowed characters as the given
chars but excluding the given delimiter. |
default Optional<String> |
filtered(String value)
Returns the given string after removing any characters that are not allowed.
|
String |
getName()
Return the name of this set of characters.
|
static final Characters.Any ANY
static final Characters.Ascii ASCII
static final Characters.CookieValue COOKIE_VALUE
static final Characters.Token TOKEN
String getName()
boolean allowed(char c)
default boolean allowed(String value)
default Optional<String> filtered(String value)
Optional.empty()
if all characters were removed or if the given
string is null.static Characters delimited(Characters chars, char delimiter)
Characters
that with the same allowed characters as the given
chars
but excluding the given delimiter.Copyright © 2024 The Cornutum Project. All rights reserved.