View Javadoc

1   /**
2    * Copyright 2010-2013 The Kuali Foundation
3    *
4    * Licensed under the Educational Community License, Version 2.0 (the "License");
5    * you may not use this file except in compliance with the License.
6    * You may obtain a copy of the License at
7    *
8    * http://www.opensource.org/licenses/ecl2.php
9    *
10   * Unless required by applicable law or agreed to in writing, software
11   * distributed under the License is distributed on an "AS IS" BASIS,
12   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13   * See the License for the specific language governing permissions and
14   * limitations under the License.
15   */
16  package org.kuali.common.util.config;
17  
18  public class DefaultProjectConfig implements ProjectConfig {
19  
20  	String groupId;
21  	String artifactId;
22  	String contextId;
23  
24  	public DefaultProjectConfig() {
25  		this(null, null);
26  	}
27  
28  	public DefaultProjectConfig(ProjectConfig request) {
29  		super();
30  		this.groupId = request.getGroupId();
31  		this.artifactId = request.getArtifactId();
32  		this.contextId = request.getContextId();
33  	}
34  
35  	public DefaultProjectConfig(String configId) {
36  		this(ConfigUtils.getProjectConfig(configId));
37  	}
38  
39  	public DefaultProjectConfig(String groupId, String artifactId) {
40  		this(groupId, artifactId, null);
41  	}
42  
43  	public DefaultProjectConfig(String groupId, String artifactId, String contextId) {
44  		super();
45  		this.groupId = groupId;
46  		this.artifactId = artifactId;
47  		this.contextId = contextId;
48  	}
49  
50  	/*
51  	 * (non-Javadoc)
52  	 * 
53  	 * @see org.kuali.common.util.config.ConfigRequest#getId()
54  	 */
55  	@Override
56  	public String getConfigId() {
57  		return ConfigUtils.getConfigId(this);
58  	}
59  
60  	/*
61  	 * (non-Javadoc)
62  	 * 
63  	 * @see org.kuali.common.util.config.ConfigRequest#getGroupId()
64  	 */
65  	@Override
66  	public String getGroupId() {
67  		return groupId;
68  	}
69  
70  	public void setGroupId(String groupId) {
71  		this.groupId = groupId;
72  	}
73  
74  	/*
75  	 * (non-Javadoc)
76  	 * 
77  	 * @see org.kuali.common.util.config.ConfigRequest#getArtifactId()
78  	 */
79  	@Override
80  	public String getArtifactId() {
81  		return artifactId;
82  	}
83  
84  	public void setArtifactId(String artifactId) {
85  		this.artifactId = artifactId;
86  	}
87  
88  	/*
89  	 * (non-Javadoc)
90  	 * 
91  	 * @see org.kuali.common.util.config.ConfigRequest#getContextId()
92  	 */
93  	@Override
94  	public String getContextId() {
95  		return contextId;
96  	}
97  
98  	public void setContextId(String contextId) {
99  		this.contextId = contextId;
100 	}
101 
102 	@Override
103 	public String toString() {
104 		return getConfigId();
105 	}
106 
107 }