View Javadoc
1   package at.rseiler.spbee.core.pojo;
2   
3   import at.rseiler.spbee.core.util.StringUtil;
4   
5   import java.io.Serializable;
6   
7   /**
8    * Holds the information of a variable or parameter.
9    *
10   * @author Reinhard Seiler {@literal <rseiler.developer@gmail.com>}
11   */
12  public class Variable implements Serializable {
13  
14      private static final long serialVersionUID = 9008463894700364670L;
15  
16      private final String name;
17      private final TypeInfo typeInfo;
18  
19      /**
20       * Constructs a new Variable.
21       *
22       * @param name               the name of the variable
23       * @param qualifiedClassName the qualified class name of the variable
24       */
25      public Variable(String name, String qualifiedClassName) {
26          this.name = name;
27          this.typeInfo = StringUtil.getTypeInfo(qualifiedClassName);
28      }
29  
30      /**
31       * The name of the variable.
32       *
33       * @return the name
34       */
35      public String getName() {
36          return name;
37      }
38  
39      /**
40       * The TypeInfo of the variable.
41       *
42       * @return the TypeInfo
43       */
44      public TypeInfo getTypeInfo() {
45          return typeInfo;
46      }
47  
48      @Override
49      public String toString() {
50          return "Variable{" +
51                  "name='" + name + '\'' +
52                  ", typeInfo=" + typeInfo +
53                  '}';
54      }
55  }