public final class PrecisProfiles
extends java.lang.Object
PrecisProfiles.USERNAME_CASE_MAPPED.prepare("UpperCaseUsername");
If the passed string contains any invalid characters, an InvalidCodePointException is thrown:
PrecisProfiles.USERNAME_CASE_MAPPED.prepare("Usernameā"); // Contains symbol, throws exception.
String enforced = PrecisProfiles.USERNAME_CASE_MAPPED.enforce("UpperCaseUsername"); // uppercaseusername
PrecisProfile.toComparableString(CharSequence) to check, if two strings compare to each other,
e.g.:
PrecisProfile profile = PrecisProfiles.USERNAME_CASE_MAPPED;
if (profile.toComparableString("foobar").equals(profile.toComparableString("FooBar"))) {
// username already exists.
}
Or you can use PrecisProfile as a Comparator:
if (profile.compare("foobar", "FooBar") == 0) {
// username already exists.
}
Note that a profile may use different rules during comparison than during enforcement (as the Nickname profile, RFC 8266).PrecisProfile| Modifier and Type | Field and Description |
|---|---|
static PrecisProfile |
IDN
A profile for preparing and enforcing international domain names.
|
static PrecisProfile |
NICKNAME
The "Nickname Profile" specified in "Preparation, Enforcement, and Comparison
of Internationalized Strings Representing Nicknames", RFC 8266.
|
static PrecisProfile |
OPAQUE_STRING
The "OpaqueString Profile" specified in "Preparation, Enforcement, and Comparison of Internationalized Strings
Representing Usernames and Passwords", RFC 8265.
|
static PrecisProfile |
USERNAME_CASE_MAPPED
The "UsernameCaseMapped Profile" specified in "Preparation, Enforcement, and Comparison of Internationalized Strings
Representing Usernames and Passwords", RFC 8265.
|
static PrecisProfile |
USERNAME_CASE_PRESERVED
The "UsernameCasePreserved Profile" specified in "Preparation, Enforcement, and Comparison of Internationalized Strings
Representing Usernames and Passwords", RFC 8265.
|
public static final PrecisProfile USERNAME_CASE_MAPPED
public static final PrecisProfile USERNAME_CASE_PRESERVED
public static final PrecisProfile OPAQUE_STRING
public static final PrecisProfile NICKNAME
public static final PrecisProfile IDN
Copyright © 2015–2019 XMPP.rocks. All rights reserved.