View Javadoc
1   /*
2    * (C) Copyright 2006-2014 Nuxeo SA (http://nuxeo.com/) and contributors.
3    *
4    * All rights reserved. This program and the accompanying materials
5    * are made available under the terms of the GNU Lesser General Public License
6    * (LGPL) version 2.1 which accompanies this distribution, and is available at
7    * http://www.gnu.org/licenses/lgpl-2.1.html
8    *
9    * This library is distributed in the hope that it will be useful,
10   * but WITHOUT ANY WARRANTY; without even the implied warranty of
11   * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12   * Lesser General Public License for more details.
13   *
14   * Contributors:
15   *     bstefanescu, slacoin
16   */
17  package org.nuxeo.build.ant.profile;
18  
19  /**
20   * TODO NXBT-258
21   */
22  public class Profile {
23  
24      protected ProfileGroup group;
25  
26      protected String name;
27  
28      private boolean isActive;
29  
30      public Profile(String name) {
31          this.name = name;
32      }
33  
34      public Profile(ProfileGroup group, String name) {
35          this.name = name;
36      }
37  
38      public boolean isActive() {
39          return isActive;
40      }
41  
42      public void setActive(boolean isActive) {
43          if (group != null) {
44              group.activateProfile(this, isActive);
45          } else {
46              _setActive(isActive);
47          }
48      }
49  
50      public String getName() {
51          return name;
52      }
53  
54      final void _setActive(@SuppressWarnings("hiding") boolean isActive) {
55          this.isActive = isActive;
56      }
57  
58  }