org.killbill.billing.osgi.pluginconf.PluginIdentifier Maven / Gradle / Ivy
/*
* Copyright 2015 Groupon, Inc
* Copyright 2015 The Billing Project, LLC
*
* The Billing Project licenses this file to you under the Apache License, version 2.0
* (the "License"); you may not use this file except in compliance with the
* License. You may obtain a copy of the License at:
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations
* under the License.
*/
package org.killbill.billing.osgi.pluginconf;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonProperty;
public class PluginIdentifier {
private final String pluginName;
private final String groupId;
private final String artifactId;
private final String packaging;
private final String classifier;
private final String version;
private final String language;
@JsonCreator
public PluginIdentifier(@JsonProperty("plugin_name") final String pluginName,
@JsonProperty("group_id") final String groupId,
@JsonProperty("artifact_id") final String artifactId,
@JsonProperty("packaging") final String packaging,
@JsonProperty("classifier") final String classifier,
@JsonProperty("version") final String version,
@JsonProperty("language") final String language) {
this.pluginName = pluginName;
this.groupId = groupId;
this.artifactId = artifactId;
this.packaging = packaging;
this.classifier = classifier;
this.version = version;
this.language = language;
}
@JsonProperty("plugin_name")
public String getPluginName() {
return pluginName;
}
@JsonProperty("group_id")
public String getGroupId() {
return groupId;
}
@JsonProperty("artifact_id")
public String getArtifactId() {
return artifactId;
}
public String getPackaging() {
return packaging;
}
public String getClassifier() {
return classifier;
}
public String getVersion() {
return version;
}
public String getLanguage() {
return language;
}
@Override
public boolean equals(final Object o) {
if (this == o) {
return true;
}
if (!(o instanceof PluginIdentifier)) {
return false;
}
final PluginIdentifier that = (PluginIdentifier) o;
if (pluginName != null ? !pluginName.equals(that.pluginName) : that.pluginName != null) {
return false;
}
if (groupId != null ? !groupId.equals(that.groupId) : that.groupId != null) {
return false;
}
if (artifactId != null ? !artifactId.equals(that.artifactId) : that.artifactId != null) {
return false;
}
if (packaging != null ? !packaging.equals(that.packaging) : that.packaging != null) {
return false;
}
if (classifier != null ? !classifier.equals(that.classifier) : that.classifier != null) {
return false;
}
if (version != null ? !version.equals(that.version) : that.version != null) {
return false;
}
return !(language != null ? !language.equals(that.language) : that.language != null);
}
@Override
public int hashCode() {
int result = pluginName != null ? pluginName.hashCode() : 0;
result = 31 * result + (groupId != null ? groupId.hashCode() : 0);
result = 31 * result + (artifactId != null ? artifactId.hashCode() : 0);
result = 31 * result + (packaging != null ? packaging.hashCode() : 0);
result = 31 * result + (classifier != null ? classifier.hashCode() : 0);
result = 31 * result + (version != null ? version.hashCode() : 0);
result = 31 * result + (language != null ? language.hashCode() : 0);
return result;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy