1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19 package org.apache.maven.message;
20
21
22
23
24
25
26
27 public interface MessageBuilder extends Appendable {
28
29
30
31
32
33
34
35
36 default MessageBuilder trace(Object message) {
37 return style("." + Constants.MAVEN_STYLE_TRACE_NAME + ":-" + Constants.MAVEN_STYLE_TRACE_DEFAULT, message);
38 }
39
40
41
42
43
44
45
46
47 default MessageBuilder debug(Object message) {
48 return style("." + Constants.MAVEN_STYLE_DEBUG_NAME + ":-" + Constants.MAVEN_STYLE_DEBUG_DEFAULT, message);
49 }
50
51
52
53
54
55
56
57
58 default MessageBuilder info(Object message) {
59 return style("." + Constants.MAVEN_STYLE_INFO_NAME + ":-" + Constants.MAVEN_STYLE_INFO_DEFAULT, message);
60 }
61
62
63
64
65
66
67
68
69 default MessageBuilder warning(Object message) {
70 return style("." + Constants.MAVEN_STYLE_WARNING_NAME + ":-" + Constants.MAVEN_STYLE_WARNING_DEFAULT, message);
71 }
72
73
74
75
76
77
78
79
80 default MessageBuilder error(Object message) {
81 return style("." + Constants.MAVEN_STYLE_ERROR_NAME + ":-" + Constants.MAVEN_STYLE_ERROR_DEFAULT, message);
82 }
83
84
85
86
87
88
89
90
91 default MessageBuilder success(Object message) {
92 return style("." + Constants.MAVEN_STYLE_SUCCESS_NAME + ":-" + Constants.MAVEN_STYLE_SUCCESS_DEFAULT, message);
93 }
94
95
96
97
98
99
100
101
102 default MessageBuilder failure(Object message) {
103 return style("." + Constants.MAVEN_STYLE_FAILURE_NAME + ":-" + Constants.MAVEN_STYLE_FAILURE_DEFAULT, message);
104 }
105
106
107
108
109
110
111
112
113 default MessageBuilder strong(Object message) {
114 return style("." + Constants.MAVEN_STYLE_STRONG_NAME + ":-" + Constants.MAVEN_STYLE_STRONG_DEFAULT, message);
115 }
116
117
118
119
120
121
122
123
124 default MessageBuilder mojo(Object message) {
125 return style("." + Constants.MAVEN_STYLE_MOJO_NAME + ":-" + Constants.MAVEN_STYLE_MOJO_DEFAULT, message);
126 }
127
128
129
130
131
132
133
134
135 default MessageBuilder project(Object message) {
136 return style("." + Constants.MAVEN_STYLE_PROJECT_NAME + ":-" + Constants.MAVEN_STYLE_PROJECT_DEFAULT, message);
137 }
138
139 default MessageBuilder style(String style, Object message) {
140 return style(style).a(message).resetStyle();
141 }
142
143 MessageBuilder style(String style);
144
145 MessageBuilder resetStyle();
146
147
148
149
150
151 @Override
152 MessageBuilder append(CharSequence cs);
153
154 @Override
155 MessageBuilder append(CharSequence cs, int start, int end);
156
157 @Override
158 MessageBuilder append(char c);
159
160
161
162
163
164
165
166
167
168 default MessageBuilder a(char[] value, int offset, int len) {
169 return append(String.valueOf(value, offset, len));
170 }
171
172
173
174
175
176
177
178 default MessageBuilder a(char[] value) {
179 return append(String.valueOf(value));
180 }
181
182
183
184
185
186
187
188
189
190 default MessageBuilder a(CharSequence value, int start, int end) {
191 return append(value, start, end);
192 }
193
194
195
196
197
198
199
200 default MessageBuilder a(CharSequence value) {
201 return append(value);
202 }
203
204
205
206
207
208
209
210 default MessageBuilder a(Object value) {
211 return append(String.valueOf(value));
212 }
213
214
215
216
217
218
219 default MessageBuilder newline() {
220 return append(System.lineSeparator());
221 }
222
223
224
225
226
227
228
229
230
231 default MessageBuilder format(String pattern, Object... args) {
232 return append(String.format(pattern, args));
233 }
234
235
236
237
238
239
240
241 MessageBuilder setLength(int length);
242
243
244
245
246
247
248 String build();
249
250 class Constants {
251
252 public static final String MAVEN_STYLE_TRANSFER_NAME = "transfer";
253 public static final String MAVEN_STYLE_TRACE_NAME = "trace";
254 public static final String MAVEN_STYLE_DEBUG_NAME = "debug";
255 public static final String MAVEN_STYLE_INFO_NAME = "info";
256 public static final String MAVEN_STYLE_WARNING_NAME = "warning";
257 public static final String MAVEN_STYLE_ERROR_NAME = "error";
258 public static final String MAVEN_STYLE_SUCCESS_NAME = "success";
259 public static final String MAVEN_STYLE_FAILURE_NAME = "failure";
260 public static final String MAVEN_STYLE_STRONG_NAME = "strong";
261 public static final String MAVEN_STYLE_MOJO_NAME = "mojo";
262 public static final String MAVEN_STYLE_PROJECT_NAME = "project";
263
264
265 public static final String MAVEN_STYLE_TRANSFER_DEFAULT = "f:bright-black";
266 public static final String MAVEN_STYLE_TRACE_DEFAULT = "bold,f:magenta";
267 public static final String MAVEN_STYLE_DEBUG_DEFAULT = "bold,f:cyan";
268 public static final String MAVEN_STYLE_INFO_DEFAULT = "bold,f:blue";
269 public static final String MAVEN_STYLE_WARNING_DEFAULT = "bold,f:yellow";
270 public static final String MAVEN_STYLE_ERROR_DEFAULT = "bold,f:red";
271 public static final String MAVEN_STYLE_SUCCESS_DEFAULT = "bold,f:green";
272 public static final String MAVEN_STYLE_FAILURE_DEFAULT = "bold,f:red";
273 public static final String MAVEN_STYLE_STRONG_DEFAULT = "bold";
274 public static final String MAVEN_STYLE_MOJO_DEFAULT = "f:green";
275 public static final String MAVEN_STYLE_PROJECT_DEFAULT = "f:cyan";
276 }
277 }