Deprecate UserId.asString()

This commit is contained in:
Paul Schaub 2022-11-30 15:35:31 +01:00
parent b0c283e143
commit 4c1d359971
1 changed files with 10 additions and 8 deletions

View File

@ -119,14 +119,6 @@ public final class UserId implements CharSequence {
@Override
public @Nonnull String toString() {
return asString();
}
/**
* Returns a string representation of the object.
* @return a string representation of the object.
*/
public String asString() {
StringBuilder sb = new StringBuilder();
if (name != null && !name.isEmpty()) {
sb.append(name);
@ -146,6 +138,16 @@ public final class UserId implements CharSequence {
return sb.toString();
}
/**
* Returns a string representation of the object.
* @return a string representation of the object.
* @deprecated use {@link #toString()} instead.
*/
@Deprecated
public String asString() {
return toString();
}
@Override
public boolean equals(Object o) {
if (o == null) return false;