View Javadoc
1   /*
2    * Licensed to the Apache Software Foundation (ASF) under one or more
3    * contributor license agreements. See the NOTICE file distributed with
4    * this work for additional information regarding copyright ownership.
5    * The ASF licenses this file to You under the Apache license, Version 2.0
6    * (the "License"); you may not use this file except in compliance with
7    * the License. You may obtain a copy of the License at
8    *
9    *      http://www.apache.org/licenses/LICENSE-2.0
10   *
11   * Unless required by applicable law or agreed to in writing, software
12   * distributed under the License is distributed on an "AS IS" BASIS,
13   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14   * See the license for the specific language governing permissions and
15   * limitations under the license.
16   */
17  package org.apache.logging.log4j.audit.generator;
18  
19  public class Parameter {
20  
21      private boolean isFinal = false;
22  
23      private String name;
24  
25      private String type;
26  
27      private String description;
28  
29      public Parameter(String name, String type, String description) {
30          this.name = name;
31          this.type = type;
32          this.description = description;
33      }
34  
35      public String getName() {
36          return name;
37      }
38  
39      public String getType() {
40          return type;
41      }
42  
43      public boolean isFinal() {
44          return isFinal;
45      }
46  
47      public void setFinal(boolean isFinal) {
48          this.isFinal = isFinal;
49      }
50  
51      public void setName(String name) {
52          this.name = name;
53      }
54  
55      public void setType(String type) {
56          this.type = type;
57      }
58  
59      public void setDescription(String description) {
60          this.description = description;
61      }
62  
63      public String getDescription() {
64          return description;
65      }
66  
67      @Override
68      public String toString() {
69          StringBuilder sb = new StringBuilder();
70          if (isFinal()) {
71              sb.append("final ");
72          }
73          sb.append(type).append(" ").append(name);
74          return sb.toString();
75      }
76  
77  }