Skip to contentMethod: getOptVariable()
      1: package model.definition;
2: 
3: /**
4:  * Representation for an Opt.
5:  * 
6:  * @author HFW410RA - Philipp Rammos
7:  * 
8:  */
9: public class Opt {
10:         /**
11:          * Represents the Opt - definition.
12:          */
13:         private final AbstractVariableDefinition optVariable;
14: 
15:         /**
16:          * Represents the name of the Opt.
17:          */
18:         private final String name;
19: 
20:         /**
21:          * Constructor, just sets fields. No side effects.
22:          * 
23:          * @param name
24:          *            The name to set.
25:          * @param optVariable
26:          *            The opt definition to set.
27:          */
28:         public Opt(final String name, final AbstractVariableDefinition optVariable) {
29:                 this.name = name;
30: 
31:                 this.optVariable = optVariable;
32:         }
33: 
34:         @Override
35:         public boolean equals(final Object obj) {
36:                 return obj instanceof Opt && ((Opt) obj).getName().equals(this.getName())
37:                                 && ((Opt) obj).getOptVariable().equals(this.getOptVariable());
38:         }
39: 
40:         @Override
41:         public int hashCode() {
42:                 return this.getName().hashCode() + this.getOptVariable().hashCode();
43:         }
44: 
45:         /**
46:          * Returns the field optVariable. no side effects.
47:          * 
48:          * @return this.optVariable
49:          */
50:         public AbstractVariableDefinition getOptVariable() {
51:                 return this.optVariable;
52:         }
53: 
54:         /**
55:          * Returns the field name. no side effects.
56:          * 
57:          * @return this.name
58:          */
59:         public String getName() {
60:                 return this.name;
61:         }
62: 
63: }