001package org.kuali.common.util.project.model;
002
003import org.kuali.common.util.Assert;
004import org.kuali.common.util.ObjectUtils;
005import org.kuali.common.util.identify.Identifiable;
006
007/**
008 * @deprecated
009 */
010@Deprecated
011public final class FeatureIdentifier implements Identifiable {
012
013        private final ProjectIdentifier project;
014        private final String featureId;
015
016        private final String identifier;
017        private final int hashCode;
018
019        public FeatureIdentifier(ProjectIdentifier project, String featureId) {
020                // Make sure we are being configured correctly
021                Assert.noNulls(project);
022                Assert.noBlanks(featureId);
023
024                // Finish setting things up
025                this.project = project;
026                this.featureId = featureId;
027                this.identifier = project.getIdentifier() + ":" + featureId;
028                this.hashCode = identifier.hashCode();
029        }
030
031        public FeatureIdentifier(String groupId, String artifactId, String featureId) {
032                this(new ProjectIdentifier(groupId, artifactId), featureId);
033        }
034
035        public ProjectIdentifier getProject() {
036                return project;
037        }
038
039        public String getFeatureId() {
040                return featureId;
041        }
042
043        @Override
044        public String getIdentifier() {
045                return identifier;
046        }
047
048        @Override
049        public String toString() {
050                return identifier;
051        }
052
053        @Override
054        public int hashCode() {
055                return hashCode;
056        }
057
058        @Override
059        public boolean equals(Object object) {
060                return ObjectUtils.equalsByToString(this, object);
061        }
062
063}