View Javadoc
1   /**
2    * This file Copyright (c) 2011-2018 Magnolia International
3    * Ltd.  (http://www.magnolia-cms.com). All rights reserved.
4    *
5    *
6    * This file is dual-licensed under both the Magnolia
7    * Network Agreement and the GNU General Public License.
8    * You may elect to use one or the other of these licenses.
9    *
10   * This file is distributed in the hope that it will be
11   * useful, but AS-IS and WITHOUT ANY WARRANTY; without even the
12   * implied warranty of MERCHANTABILITY or FITNESS FOR A
13   * PARTICULAR PURPOSE, TITLE, or NONINFRINGEMENT.
14   * Redistribution, except as permitted by whichever of the GPL
15   * or MNA you select, is prohibited.
16   *
17   * 1. For the GPL license (GPL), you can redistribute and/or
18   * modify this file under the terms of the GNU General
19   * Public License, Version 3, as published by the Free Software
20   * Foundation.  You should have received a copy of the GNU
21   * General Public License, Version 3 along with this program;
22   * if not, write to the Free Software Foundation, Inc., 51
23   * Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
24   *
25   * 2. For the Magnolia Network Agreement (MNA), this file
26   * and the accompanying materials are made available under the
27   * terms of the MNA which accompanies this distribution, and
28   * is available at http://www.magnolia-cms.com/mna.html
29   *
30   * Any modifications to this file must keep this entire header
31   * intact.
32   *
33   */
34  package info.magnolia.module.model;
35  
36  import java.lang.annotation.Annotation;
37  import java.util.Objects;
38  
39  
40  /**
41   * Component as defined in module descriptor.
42   *
43   * @see ModuleDefinition
44   */
45  public class ComponentDefinition {
46  
47      public static final String SCOPE_SINGLETON = "singleton";
48      public static final String SCOPE_LOCAL = "local";
49      public static final String SCOPE_SESSION = "session";
50  
51      private String type;
52      private String implementation;
53      private String observed;
54      private String workspace;
55      private String path;
56      private String provider;
57      private String scope;
58      private String lazy;
59      private Annotation bindingContext;
60  
61      public String getType() {
62          return type;
63      }
64  
65      public void setType(String type) {
66          this.type = type;
67      }
68  
69      public String getImplementation() {
70          return implementation;
71      }
72  
73      public void setImplementation(String implementation) {
74          this.implementation = implementation;
75      }
76  
77      public String getObserved() {
78          return observed;
79      }
80  
81      public void setObserved(String observed) {
82          this.observed = observed;
83      }
84  
85      public String getWorkspace() {
86          return workspace;
87      }
88  
89      public void setWorkspace(String workspace) {
90          this.workspace = workspace;
91      }
92  
93      public String getPath() {
94          return path;
95      }
96  
97      public void setPath(String path) {
98          this.path = path;
99      }
100 
101     public String getProvider() {
102         return provider;
103     }
104 
105     public void setProvider(String provider) {
106         this.provider = provider;
107     }
108 
109     public String getScope() {
110         return scope;
111     }
112 
113     public void setScope(String scope) {
114         this.scope = scope;
115     }
116 
117     public String getLazy() {
118         return lazy;
119     }
120 
121     public void setLazy(String lazy) {
122         this.lazy = lazy;
123     }
124 
125     public Annotation getBindingContext() {
126         return this.bindingContext;
127     }
128 
129     public void setBindingContext(Annotation bindingContext) {
130         this.bindingContext = bindingContext;
131     }
132 
133     @Override
134     public boolean equals(Object o) {
135         if (this == o) return true;
136         if (o == null || getClass() != o.getClass()) return false;
137 
138         ComponentDefinition/info/magnolia/module/model/ComponentDefinition.html#ComponentDefinition">ComponentDefinition that = (ComponentDefinition) o;
139 
140         return  Objects.equals(this.type, that.type) &&
141                 Objects.equals(this.implementation, that.implementation) &&
142                 Objects.equals(this.observed, that.observed) &&
143                 Objects.equals(this.workspace, that.workspace) &&
144                 Objects.equals(this.path, that.path) &&
145                 Objects.equals(this.provider, that.provider) &&
146                 Objects.equals(this.scope, that.scope) &&
147                 Objects.equals(this.lazy, that.lazy) &&
148                 Objects.equals(this.bindingContext, that.bindingContext);
149     }
150 
151     @Override
152     public int hashCode() {
153         return Objects.hash(type, implementation, observed, workspace, path, provider, scope, lazy, bindingContext);
154     }
155 }