1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34 package info.magnolia.module.model;
35
36 import java.lang.annotation.Annotation;
37
38
39
40
41
42
43 public class ComponentDefinition {
44
45 public static final String SCOPE_SINGLETON = "singleton";
46 public static final String SCOPE_LOCAL = "local";
47 public static final String SCOPE_SESSION = "session";
48
49 private String type;
50 private String implementation;
51 private String observed;
52 private String workspace;
53 private String path;
54 private String provider;
55 private String scope;
56 private String lazy;
57 private Annotation bindingContext;
58
59 public String getType() {
60 return type;
61 }
62
63 public void setType(String type) {
64 this.type = type;
65 }
66
67 public String getImplementation() {
68 return implementation;
69 }
70
71 public void setImplementation(String implementation) {
72 this.implementation = implementation;
73 }
74
75 public String getObserved() {
76 return observed;
77 }
78
79 public void setObserved(String observed) {
80 this.observed = observed;
81 }
82
83 public String getWorkspace() {
84 return workspace;
85 }
86
87 public void setWorkspace(String workspace) {
88 this.workspace = workspace;
89 }
90
91 public String getPath() {
92 return path;
93 }
94
95 public void setPath(String path) {
96 this.path = path;
97 }
98
99 public String getProvider() {
100 return provider;
101 }
102
103 public void setProvider(String provider) {
104 this.provider = provider;
105 }
106
107 public String getScope() {
108 return scope;
109 }
110
111 public void setScope(String scope) {
112 this.scope = scope;
113 }
114
115 public String getLazy() {
116 return lazy;
117 }
118
119 public void setLazy(String lazy) {
120 this.lazy = lazy;
121 }
122
123 public Annotation getBindingContext() {
124 return this.bindingContext;
125 }
126
127 public void setBindingContext(Annotation appScope) {
128 this.bindingContext = appScope;
129 }
130
131 @Override
132 public boolean equals(Object o) {
133 if (this == o) return true;
134 if (!(o instanceof ComponentDefinition)) return false;
135
136 ComponentDefinition that = (ComponentDefinition) o;
137
138 if (!type.equals(that.type)) return false;
139 if (!implementation.equals(that.implementation)) return false;
140 if (observed != null ? !observed.equals(that.observed) : that.observed != null) return false;
141 if (workspace != null ? !workspace.equals(that.workspace) : that.workspace != null) return false;
142 if (path != null ? !path.equals(that.path) : that.path != null) return false;
143 if (provider != null ? !provider.equals(that.provider) : that.provider != null) return false;
144 if (scope != null ? !scope.equals(that.scope) : that.scope != null) return false;
145 if (lazy != null ? !lazy.equals(that.lazy) : that.lazy != null) return false;
146 return bindingContext != null ? bindingContext.equals(that.bindingContext) : that.bindingContext == null;
147 }
148
149 @Override
150 public int hashCode() {
151 int result = type.hashCode();
152 result = 31 * result + implementation.hashCode();
153 result = 31 * result + (observed != null ? observed.hashCode() : 0);
154 result = 31 * result + (workspace != null ? workspace.hashCode() : 0);
155 result = 31 * result + (path != null ? path.hashCode() : 0);
156 result = 31 * result + (provider != null ? provider.hashCode() : 0);
157 result = 31 * result + (scope != null ? scope.hashCode() : 0);
158 result = 31 * result + (lazy != null ? lazy.hashCode() : 0);
159 result = 31 * result + (bindingContext != null ? bindingContext.hashCode() : 0);
160 return result;
161 }
162 }