![JAR search and dependency download from the Maven repository](/logo.png)
org.linuxstuff.mojo.licensing.model.DualLicense Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of licensing-maven-plugin Show documentation
Show all versions of licensing-maven-plugin Show documentation
Forked from http://github.com/idcmp/licensing-maven-plugin
package org.linuxstuff.mojo.licensing.model;
import java.util.Set;
import com.thoughtworks.xstream.annotations.XStreamAlias;
import com.thoughtworks.xstream.annotations.XStreamAsAttribute;
import com.thoughtworks.xstream.annotations.XStreamImplicit;
@XStreamAlias("dual-license")
public class DualLicense {
@XStreamAsAttribute
@XStreamAlias("name")
private String finalName;
@XStreamImplicit(itemFieldName = "option")
private Set optionalLicenses;
public DualLicense(String finalName, Set optionalLicenses) {
this.finalName = finalName;
this.optionalLicenses = optionalLicenses;
}
public String getFinalName() {
return finalName;
}
public Set getOptionalLicenses() {
return optionalLicenses;
}
@Override
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result + ((finalName == null) ? 0 : finalName.hashCode());
return result;
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
DualLicense other = (DualLicense) obj;
if (finalName == null) {
if (other.finalName != null)
return false;
} else if (!finalName.equals(other.finalName))
return false;
return true;
}
/**
* This method does not attempt to do anything creative with cascading final
* names or anything. It simply combines the "optional licenses" of the other
* {@code DualLicense}.
*/
public void combineWith(DualLicense other) {
optionalLicenses.addAll(other.getOptionalLicenses());
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy