View Javadoc
1   /*
2    * dpkg - Debian Package library and the Debian Package Maven plugin
3    * (c) Copyright 2016 Gerrit Hohl
4    *
5    * This program is free software; you can redistribute it and/or
6    * modify it under the terms of the GNU General Public License
7    * as published by the Free Software Foundation; either version 2
8    * of the License, or (at your option) any later version.
9    *
10   * This program is distributed in the hope that it will be useful,
11   * but WITHOUT ANY WARRANTY; without even the implied warranty of
12   * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13   * GNU General Public License for more details.
14   *
15   * You should have received a copy of the GNU General Public License
16   * along with this program; if not, write to the Free Software
17   * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
18   */
19  package net.sourceforge.javadpkg.impl;
20  
21  import net.sourceforge.javadpkg.Warning;
22  
23  /**
24   * <p>
25   * A warning that the format of the initial line of a version in the change log
26   * is unsupported.
27   * </p>
28   *
29   * @author Gerrit Hohl (gerrit-hohl@users.sourceforge.net)
30   * @version <b>1.0</b>, 06.05.2016 by Gerrit Hohl
31   */
32  public class ChangeLogInitialLineUnsupportedWarning implements Warning {
33  	
34  	
35  	/** The initial line. */
36  	private String	initialLine;
37  	/** The reason. */
38  	private String	reason;
39  	
40  	
41  	/**
42  	 * <p>
43  	 * Creates a warning.
44  	 * </p>
45  	 *
46  	 * @param initialLine
47  	 *            The initial line.
48  	 * @param reason
49  	 *            The reason.
50  	 * @throws IllegalArgumentException
51  	 *             If any of the parameters are <code>null</code>.
52  	 */
53  	public ChangeLogInitialLineUnsupportedWarning(String initialLine, String reason) {
54  		super();
55  		
56  		if (initialLine == null)
57  			throw new IllegalArgumentException("Argument initialLine is null.");
58  		if (reason == null)
59  			throw new IllegalArgumentException("Argument reason is null.");
60  		
61  		this.initialLine = initialLine;
62  		this.reason = reason;
63  	}
64  	
65  	
66  	@Override
67  	public String getText() {
68  		StringBuilder sb;
69  		
70  		
71  		sb = new StringBuilder();
72  		sb.append("The format of the initial line |");
73  		sb.append(this.initialLine);
74  		sb.append("| of a version in the change log is not supported. The reason: ");
75  		sb.append(this.reason);
76  		
77  		return sb.toString();
78  	}
79  
80  
81  }