View Javadoc
1   package org.apache.maven.shared.utils.logging;
2   
3   /*
4    * Licensed to the Apache Software Foundation (ASF) under one
5    * or more contributor license agreements.  See the NOTICE file
6    * distributed with this work for additional information
7    * regarding copyright ownership.  The ASF licenses this file
8    * to you under the Apache License, Version 2.0 (the
9    * "License"); you may not use this file except in compliance
10   * with the License.  You may obtain a copy of the License at
11   *
12   *  http://www.apache.org/licenses/LICENSE-2.0
13   *
14   * Unless required by applicable law or agreed to in writing,
15   * software distributed under the License is distributed on an
16   * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
17   * KIND, either express or implied.  See the License for the
18   * specific language governing permissions and limitations
19   * under the License.
20   */
21  
22  /**
23   * Message builder that supports configurable styling.
24   * @see MessageUtils
25   * @since 3.1.0
26   */
27  public interface MessageBuilder
28  {
29      /**
30       * Append message content in success style.
31       * By default, bold green
32       */
33      MessageBuilder success( Object message );
34      
35      /**
36       * Append message content in warning style.
37       * By default, bold yellow
38       */
39      MessageBuilder warning( Object message );
40      
41      /**
42       * Append message content in failure style.
43       * By default, bold red
44       */
45      MessageBuilder failure( Object message );
46  
47      /**
48       * Append message content in strong style.
49       * By default, bold
50       */
51      MessageBuilder strong( Object message );
52      
53      /**
54       * Append message content in mojo style.
55       * By default, green
56       */
57      MessageBuilder mojo( Object message );
58      
59      /**
60       * Append message content in project style.
61       * By default, cyan
62       */
63      MessageBuilder project( Object message );
64      
65      //
66      // message building methods modelled after Ansi methods
67      //
68      /**
69       * Append content to the message buffer.
70       */
71      MessageBuilder a( char[] value, int offset, int len );
72  
73      /**
74       * Append content to the message buffer.
75       */
76      MessageBuilder a( char[] value );
77  
78      /**
79       * Append content to the message buffer.
80       */
81      MessageBuilder a( CharSequence value, int start, int end );
82  
83      /**
84       * Append content to the message buffer.
85       */
86      MessageBuilder a( CharSequence value );
87  
88      /**
89       * Append content to the message buffer.
90       */
91      MessageBuilder a( Object value );
92  
93      /**
94       * Append newline to the message buffer.
95       */
96      MessageBuilder newline();
97  
98      /**
99       * Append formatted content to the buffer.
100      * @see String#format(String, Object...)
101      */
102     MessageBuilder format( String pattern, Object... args );
103 }