001/**
002 * Copyright 2010-2014 The Kuali Foundation
003 *
004 * Licensed under the Educational Community License, Version 2.0 (the "License");
005 * you may not use this file except in compliance with the License.
006 * You may obtain a copy of the License at
007 *
008 * http://www.opensource.org/licenses/ecl2.php
009 *
010 * Unless required by applicable law or agreed to in writing, software
011 * distributed under the License is distributed on an "AS IS" BASIS,
012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
013 * See the License for the specific language governing permissions and
014 * limitations under the License.
015 */
016package org.kuali.common.util.project.model;
017
018import org.kuali.common.util.Assert;
019import org.kuali.common.util.ObjectUtils;
020import org.kuali.common.util.identify.Identifiable;
021
022/**
023 * @deprecated
024 */
025@Deprecated
026public final class FeatureIdentifier implements Identifiable {
027
028        private final ProjectIdentifier project;
029        private final String featureId;
030
031        private final String identifier;
032        private final int hashCode;
033
034        public FeatureIdentifier(ProjectIdentifier project, String featureId) {
035                // Make sure we are being configured correctly
036                Assert.noNulls(project);
037                Assert.noBlanks(featureId);
038
039                // Finish setting things up
040                this.project = project;
041                this.featureId = featureId;
042                this.identifier = project.getIdentifier() + ":" + featureId;
043                this.hashCode = identifier.hashCode();
044        }
045
046        public FeatureIdentifier(String groupId, String artifactId, String featureId) {
047                this(new ProjectIdentifier(groupId, artifactId), featureId);
048        }
049
050        public ProjectIdentifier getProject() {
051                return project;
052        }
053
054        public String getFeatureId() {
055                return featureId;
056        }
057
058        @Override
059        public String getIdentifier() {
060                return identifier;
061        }
062
063        @Override
064        public String toString() {
065                return identifier;
066        }
067
068        @Override
069        public int hashCode() {
070                return hashCode;
071        }
072
073        @Override
074        public boolean equals(Object object) {
075                return ObjectUtils.equalsByToString(this, object);
076        }
077
078}