1 /* 2 * Licensed to the Apache Software Foundation (ASF) under one 3 * or more contributor license agreements. See the NOTICE file 4 * distributed with this work for additional information 5 * regarding copyright ownership. The ASF licenses this file 6 * to you under the Apache License, Version 2.0 (the 7 * "License"); you may not use this file except in compliance 8 * with the License. You may obtain a copy of the License at 9 * 10 * http://www.apache.org/licenses/LICENSE-2.0 11 * 12 * Unless required by applicable law or agreed to in writing, 13 * software distributed under the License is distributed on an 14 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 * KIND, either express or implied. See the License for the 16 * specific language governing permissions and limitations 17 * under the License. 18 */ 19 package org.apache.maven.plugins.assembly.io; 20 21 /** 22 * Message Holder class. 23 * 24 */ 25 interface MessageHolder { 26 27 /** 28 * @return {@link MessageHolder} 29 */ 30 MessageHolder newMessage(); 31 32 /** 33 * @return {@link MessageHolder} 34 */ 35 MessageHolder newDebugMessage(); 36 37 /** 38 * @return {@link MessageHolder} 39 */ 40 MessageHolder newInfoMessage(); 41 42 /** 43 * @return {@link MessageHolder} 44 */ 45 MessageHolder newWarningMessage(); 46 47 /** 48 * @return {@link MessageHolder} 49 */ 50 MessageHolder newErrorMessage(); 51 52 /** 53 * @return {@link MessageHolder} 54 */ 55 MessageHolder newSevereMessage(); 56 57 /** 58 * @param messagePart message part. 59 * @return {@link MessageHolder} 60 */ 61 MessageHolder append(CharSequence messagePart); 62 63 /** 64 * @param error {@link Throwable} 65 * @return {@link MessageHolder} 66 */ 67 MessageHolder append(Throwable error); 68 69 /** 70 * @param messagePart Message Part. 71 * @param error {@link Throwable} 72 * @return {@link MessageHolder} 73 */ 74 MessageHolder addMessage(CharSequence messagePart, Throwable error); 75 76 /** 77 * @param messagePart message part. 78 * @return {@link MessageHolder} 79 */ 80 MessageHolder addMessage(CharSequence messagePart); 81 82 /** 83 * @param error {@link Throwable} 84 * @return {@link MessageHolder} 85 */ 86 MessageHolder addMessage(Throwable error); 87 88 /** 89 * @param messagePart message part. 90 * @param error {@link Throwable} 91 * @return {@link MessageHolder} 92 */ 93 MessageHolder addDebugMessage(CharSequence messagePart, Throwable error); 94 95 /** 96 * @param messagePart messages part. 97 * @return {@link MessageHolder} 98 */ 99 MessageHolder addDebugMessage(CharSequence messagePart); 100 101 /** 102 * @param error messages part. 103 * @return {@link MessageHolder} 104 */ 105 MessageHolder addDebugMessage(Throwable error); 106 107 /** 108 * @param messagePart message part. 109 * @param error {@link Throwable} 110 * @return {@link MessageHolder} 111 */ 112 MessageHolder addInfoMessage(CharSequence messagePart, Throwable error); 113 114 /** 115 * @param messagePart messages part. 116 * @return {@link MessageHolder} 117 */ 118 MessageHolder addInfoMessage(CharSequence messagePart); 119 120 /** 121 * @param error {@link Throwable} 122 * @return {@link MessageHolder} 123 */ 124 MessageHolder addInfoMessage(Throwable error); 125 126 /** 127 * @param messagePart message part. 128 * @param error {@link Throwable} 129 * @return {@link MessageHolder} 130 */ 131 MessageHolder addWarningMessage(CharSequence messagePart, Throwable error); 132 133 /** 134 * @param messagePart message part. 135 * @return {@link MessageHolder} 136 */ 137 MessageHolder addWarningMessage(CharSequence messagePart); 138 139 /** 140 * @param error {@link Throwable} 141 * @return {@link MessageHolder} 142 */ 143 MessageHolder addWarningMessage(Throwable error); 144 145 /** 146 * @param messagePart message part. 147 * @param error {@link Throwable} 148 * @return {@link MessageHolder} 149 */ 150 MessageHolder addErrorMessage(CharSequence messagePart, Throwable error); 151 152 /** 153 * @param messagePart message part. 154 * @return {@link MessageHolder} 155 */ 156 MessageHolder addErrorMessage(CharSequence messagePart); 157 158 /** 159 * @param error {@link Throwable} 160 * @return {@link MessageHolder} 161 */ 162 MessageHolder addErrorMessage(Throwable error); 163 164 /** 165 * @param messagePart message part. 166 * @param error {@link Throwable} 167 * @return {@link MessageHolder} 168 */ 169 MessageHolder addSevereMessage(CharSequence messagePart, Throwable error); 170 171 /** 172 * @param messagePart message part. 173 * @return {@link MessageHolder} 174 */ 175 MessageHolder addSevereMessage(CharSequence messagePart); 176 177 /** 178 * @param error The error. 179 * @return {@link MessageHolder} 180 */ 181 MessageHolder addSevereMessage(Throwable error); 182 183 /** 184 * @return the size. 185 */ 186 int size(); 187 188 /** 189 * @return count number of messages. 190 */ 191 int countMessages(); 192 193 /** 194 * @return count number of debug messages. 195 */ 196 int countDebugMessages(); 197 198 /** 199 * @return count number of info messages 200 */ 201 int countInfoMessages(); 202 203 /** 204 * @return count number of warning messages 205 */ 206 int countWarningMessages(); 207 208 /** 209 * @return count number of error messages 210 */ 211 int countErrorMessages(); 212 213 /** 214 * @return count number of server messages 215 */ 216 int countSevereMessages(); 217 218 /** 219 * @return true / false. 220 */ 221 boolean isDebugEnabled(); 222 223 /** 224 * @param enabled enable debug 225 */ 226 void setDebugEnabled(boolean enabled); 227 228 /** 229 * @return true if info is enabled false otherwise 230 */ 231 boolean isInfoEnabled(); 232 233 /** 234 * @param enabled true info enable false otherwise. 235 */ 236 void setInfoEnabled(boolean enabled); 237 238 /** 239 * @return true if warning is enabled false otherwise. 240 */ 241 boolean isWarningEnabled(); 242 243 /** 244 * @param enabled enable warning or disable. 245 */ 246 void setWarningEnabled(boolean enabled); 247 248 /** 249 * @return true if error is enabled false otherwise. 250 */ 251 boolean isErrorEnabled(); 252 253 /** 254 * @param enabled enable error or disable 255 */ 256 void setErrorEnabled(boolean enabled); 257 258 /** 259 * @return true if severe is enabled false otherwise. 260 */ 261 boolean isSevereEnabled(); 262 263 /** 264 * @param enabled enable severe or disable 265 */ 266 void setSevereEnabled(boolean enabled); 267 268 /** 269 * @return true if empty, false otherwise 270 */ 271 boolean isEmpty(); 272 273 /** 274 * @return rendered 275 */ 276 String render(); 277 278 /** 279 * @param sink {@link MessageSink} 280 */ 281 void render(MessageSink sink); 282 283 /** 284 * flush 285 */ 286 void flush(); 287 }