Skip to contentMethod: getValue()
      1: /**
2:  * 
3:  */
4: package model.packages;
5: 
6: import scanner.ScannerConstants;
7: 
8: /**
9:  * This class represents the options of the package rule.
10:  * 
11:  * @author HFW410
12:  * 
13:  */
14: public class Option {
15:         /**
16:          * represents the value of the option.
17:          */
18:         private final String value;
19:         /**
20:          * represents the name of the option.
21:          */
22:         private final String name;
23: 
24:         /**
25:          * @param value
26:          *            of the option
27:          * @param name
28:          *            of the option
29:          */
30:         public Option(final String name, final String value) {
31:                 super();
32:                 this.value = value;
33:                 this.name = name;
34:         }
35: 
36:         /**
37:          * @return the value
38:          */
39:         public String getValue() {
40:                 return this.value;
41:         }
42: 
43:         /**
44:          * @return the name
45:          */
46:         public String getName() {
47:                 return this.name;
48:         }
49: 
50:         @Override
51:         public String toString() {
52:                 return this.getName() + ScannerConstants.COLONSIGN.toString() + this.getValue();
53:         }
54: 
55:         @Override
56:         public boolean equals(final Object obj) {
57:                 return obj instanceof Option && ((Option) obj).getName().equals(this.getName())
58:                                 && ((Option) obj).getValue().equals(this.getValue());
59: 
60:         }
61: 
62:         @Override
63:         public int hashCode() {
64:                 return this.getName().hashCode() + this.getValue().hashCode();
65:         }
66: 
67: }