OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2011 Google Inc. | 2 * Copyright 2011 Google Inc. |
3 * | 3 * |
4 * Licensed under the Apache License, Version 2.0 (the "License"); | 4 * Licensed under the Apache License, Version 2.0 (the "License"); |
5 * you may not use this file except in compliance with the License. | 5 * you may not use this file except in compliance with the License. |
6 * You may obtain a copy of the License at | 6 * You may obtain a copy of the License at |
7 * | 7 * |
8 * http://www.apache.org/licenses/LICENSE-2.0 | 8 * http://www.apache.org/licenses/LICENSE-2.0 |
9 * | 9 * |
10 * Unless required by applicable law or agreed to in writing, software | 10 * Unless required by applicable law or agreed to in writing, software |
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
100 */ | 100 */ |
101 public TextBuilder append(int i) { | 101 public TextBuilder append(int i) { |
102 builder.append(i); | 102 builder.append(i); |
103 return this; | 103 return this; |
104 } | 104 } |
105 | 105 |
106 /** | 106 /** |
107 * Appends the toString representation of {@code object} to this builder. | 107 * Appends the toString representation of {@code object} to this builder. |
108 */ | 108 */ |
109 public TextBuilder append(Object object) { | 109 public TextBuilder append(Object object) { |
110 builder.append(object); | 110 if (object instanceof InternalBase) { |
111 return this; | 111 return append((InternalBase) object); |
| 112 } else { |
| 113 builder.append(object); |
| 114 return this; |
| 115 } |
112 } | 116 } |
113 | 117 |
114 /** | 118 /** |
115 * Appends the {@code InternalBase#toCompactString} representation of {@code o
bject} to this | 119 * Appends the {@code InternalBase#toCompactString} representation of {@code o
bject} to this |
116 * builder. | 120 * builder. |
117 */ | 121 */ |
118 public TextBuilder append(InternalBase object) { | 122 public TextBuilder append(InternalBase object) { |
119 if (object == null) { | 123 if (object == null) { |
120 return append("null"); | 124 return append("null"); |
121 } | 125 } |
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
193 public TextBuilder appendFormat(String format, Object... args) { | 197 public TextBuilder appendFormat(String format, Object... args) { |
194 formatter.format(format, args); | 198 formatter.format(format, args); |
195 return this; | 199 return this; |
196 } | 200 } |
197 | 201 |
198 @Override | 202 @Override |
199 public String toString() { | 203 public String toString() { |
200 return builder.toString(); | 204 return builder.toString(); |
201 } | 205 } |
202 } | 206 } |
OLD | NEW |