mirror of
https://github.com/apache/commons-lang.git
synced 2025-02-06 10:08:32 +00:00
Refactor magic char.
This commit is contained in:
parent
8dae1f2904
commit
4f928504ea
@ -46,6 +46,8 @@
|
||||
// because it is part of the signature of deprecated methods
|
||||
public class ObjectUtils {
|
||||
|
||||
private static final char AT_SIGN = '@';
|
||||
|
||||
/**
|
||||
* <p>Singleton used as a {@code null} placeholder where
|
||||
* {@code null} has another meaning.</p>
|
||||
@ -355,7 +357,7 @@ public static String identityToString(final Object object) {
|
||||
public static void identityToString(final Appendable appendable, final Object object) throws IOException {
|
||||
Validate.notNull(object, "Cannot get the toString of a null object");
|
||||
appendable.append(object.getClass().getName())
|
||||
.append('@')
|
||||
.append(AT_SIGN)
|
||||
.append(Integer.toHexString(System.identityHashCode(object)));
|
||||
}
|
||||
|
||||
@ -380,7 +382,7 @@ public static void identityToString(final Appendable appendable, final Object ob
|
||||
public static void identityToString(final StrBuilder builder, final Object object) {
|
||||
Validate.notNull(object, "Cannot get the toString of a null object");
|
||||
builder.append(object.getClass().getName())
|
||||
.append('@')
|
||||
.append(AT_SIGN)
|
||||
.append(Integer.toHexString(System.identityHashCode(object)));
|
||||
}
|
||||
|
||||
@ -402,7 +404,7 @@ public static void identityToString(final StrBuilder builder, final Object objec
|
||||
public static void identityToString(final StringBuffer buffer, final Object object) {
|
||||
Validate.notNull(object, "Cannot get the toString of a null object");
|
||||
buffer.append(object.getClass().getName())
|
||||
.append('@')
|
||||
.append(AT_SIGN)
|
||||
.append(Integer.toHexString(System.identityHashCode(object)));
|
||||
}
|
||||
|
||||
@ -424,7 +426,7 @@ public static void identityToString(final StringBuffer buffer, final Object obje
|
||||
public static void identityToString(final StringBuilder builder, final Object object) {
|
||||
Validate.notNull(object, "Cannot get the toString of a null object");
|
||||
builder.append(object.getClass().getName())
|
||||
.append('@')
|
||||
.append(AT_SIGN)
|
||||
.append(Integer.toHexString(System.identityHashCode(object)));
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user