MCPcopy
hub / github.com/orhanobut/logger / toString

Method toString

logger/src/main/java/com/orhanobut/logger/Utils.java:114–149  ·  view source on GitHub ↗
(Object object)

Source from the content-addressed store, hash-verified

112 }
113
114 public static String toString(Object object) {
115 if (object == null) {
116 return "null";
117 }
118 if (!object.getClass().isArray()) {
119 return object.toString();
120 }
121 if (object instanceof boolean[]) {
122 return Arrays.toString((boolean[]) object);
123 }
124 if (object instanceof byte[]) {
125 return Arrays.toString((byte[]) object);
126 }
127 if (object instanceof char[]) {
128 return Arrays.toString((char[]) object);
129 }
130 if (object instanceof short[]) {
131 return Arrays.toString((short[]) object);
132 }
133 if (object instanceof int[]) {
134 return Arrays.toString((int[]) object);
135 }
136 if (object instanceof long[]) {
137 return Arrays.toString((long[]) object);
138 }
139 if (object instanceof float[]) {
140 return Arrays.toString((float[]) object);
141 }
142 if (object instanceof double[]) {
143 return Arrays.toString((double[]) object);
144 }
145 if (object instanceof Object[]) {
146 return Arrays.deepToString((Object[]) object);
147 }
148 return "Couldn't find a correct type for the object";
149 }
150
151 @NonNull static <T> T checkNotNull(@Nullable final T obj) {
152 if (obj == null) {

Callers 14

objectToStringMethod · 0.95
toStringWithNullMethod · 0.95
dMethod · 0.95
logWithBigChunkMethod · 0.80
logListMethod · 0.80
logMapMethod · 0.80
logSetMethod · 0.80
getStackTraceStringMethod · 0.80
logMethod · 0.80
jsonMethod · 0.80

Calls

no outgoing calls

Tested by 8

objectToStringMethod · 0.76
toStringWithNullMethod · 0.76
logWithBigChunkMethod · 0.64
logListMethod · 0.64
logMapMethod · 0.64
logSetMethod · 0.64