org.apache.maven.model.Model Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of maven-model Show documentation
Show all versions of maven-model Show documentation
Model for Maven POM (Project Object Model)
The newest version!
// =================== DO NOT EDIT THIS FILE ====================
// Generated by Modello Velocity from model-v3.vm
// template, any modifications will be overwritten.
// ==============================================================
package org.apache.maven.model;
import java.io.Serializable;
import java.nio.file.Path;
import java.util.AbstractList;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.Properties;
import java.util.Set;
import java.util.stream.Collectors;
import java.util.stream.Stream;
import org.apache.maven.api.annotations.Generated;
import org.apache.maven.api.annotations.Nonnull;
import org.codehaus.plexus.util.xml.Xpp3Dom;
@Generated
public class Model
extends ModelBase
implements Serializable, Cloneable
{
public Model() {
this(org.apache.maven.api.model.Model.newInstance());
}
public Model(org.apache.maven.api.model.Model delegate) {
this(delegate, null);
}
public Model(org.apache.maven.api.model.Model delegate, BaseObject parent) {
super(delegate, parent);
}
public Model clone(){
return new Model(getDelegate());
}
@Override
public org.apache.maven.api.model.Model getDelegate() {
return (org.apache.maven.api.model.Model) super.getDelegate();
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || !(o instanceof Model)) {
return false;
}
Model that = (Model) o;
return Objects.equals(this.delegate, that.delegate);
}
@Override
public int hashCode() {
return getDelegate().hashCode();
}
public String getModelEncoding() {
return getDelegate().getModelEncoding();
}
public String getModelVersion() {
return getDelegate().getModelVersion();
}
public void setModelVersion(String modelVersion) {
if (!Objects.equals(modelVersion, getModelVersion())) {
update(getDelegate().withModelVersion(modelVersion));
}
}
public Parent getParent() {
return getDelegate().getParent() != null ? new Parent(getDelegate().getParent(), this) : null;
}
public void setParent(Parent parent) {
if (!Objects.equals(parent, getParent())){
if (parent != null) {
update(getDelegate().withParent(parent.getDelegate()));
parent.childrenTracking = this::replace;
} else {
update(getDelegate().withParent(null));
}
}
}
public String getGroupId() {
return getDelegate().getGroupId();
}
public void setGroupId(String groupId) {
if (!Objects.equals(groupId, getGroupId())) {
update(getDelegate().withGroupId(groupId));
}
}
public String getArtifactId() {
return getDelegate().getArtifactId();
}
public void setArtifactId(String artifactId) {
if (!Objects.equals(artifactId, getArtifactId())) {
update(getDelegate().withArtifactId(artifactId));
}
}
public String getVersion() {
return getDelegate().getVersion();
}
public void setVersion(String version) {
if (!Objects.equals(version, getVersion())) {
update(getDelegate().withVersion(version));
}
}
public String getPackaging() {
return getDelegate().getPackaging();
}
public void setPackaging(String packaging) {
if (!Objects.equals(packaging, getPackaging())) {
update(getDelegate().withPackaging(packaging));
}
}
public String getName() {
return getDelegate().getName();
}
public void setName(String name) {
if (!Objects.equals(name, getName())) {
update(getDelegate().withName(name));
}
}
public String getDescription() {
return getDelegate().getDescription();
}
public void setDescription(String description) {
if (!Objects.equals(description, getDescription())) {
update(getDelegate().withDescription(description));
}
}
public String getUrl() {
return getDelegate().getUrl();
}
public void setUrl(String url) {
if (!Objects.equals(url, getUrl())) {
update(getDelegate().withUrl(url));
}
}
public String getChildProjectUrlInheritAppendPath() {
return getDelegate().getChildProjectUrlInheritAppendPath();
}
public void setChildProjectUrlInheritAppendPath(String childProjectUrlInheritAppendPath) {
if (!Objects.equals(childProjectUrlInheritAppendPath, getChildProjectUrlInheritAppendPath())) {
update(getDelegate().withChildProjectUrlInheritAppendPath(childProjectUrlInheritAppendPath));
}
}
public String getInceptionYear() {
return getDelegate().getInceptionYear();
}
public void setInceptionYear(String inceptionYear) {
if (!Objects.equals(inceptionYear, getInceptionYear())) {
update(getDelegate().withInceptionYear(inceptionYear));
}
}
public Organization getOrganization() {
return getDelegate().getOrganization() != null ? new Organization(getDelegate().getOrganization(), this) : null;
}
public void setOrganization(Organization organization) {
if (!Objects.equals(organization, getOrganization())){
if (organization != null) {
update(getDelegate().withOrganization(organization.getDelegate()));
organization.childrenTracking = this::replace;
} else {
update(getDelegate().withOrganization(null));
}
}
}
@Nonnull
public List getLicenses() {
return new WrapperList(
() -> getDelegate().getLicenses(), l -> update(getDelegate().withLicenses(l)),
d -> new License(d, this), License::getDelegate);
}
public void setLicenses(List licenses) {
if (licenses == null) {
licenses = Collections.emptyList();
}
if (!Objects.equals(licenses, getLicenses())) {
update(getDelegate().withLicenses(
licenses.stream().map(c -> c.getDelegate()).collect(Collectors.toList())));
licenses.forEach(e -> e.childrenTracking = this::replace);
}
}
public void addLicense(License license) {
update(getDelegate().withLicenses(
Stream.concat(getDelegate().getLicenses().stream(), Stream.of(license.getDelegate()))
.collect(Collectors.toList())));
license.childrenTracking = this::replace;
}
public void removeLicense(License license) {
update(getDelegate().withLicenses(
getDelegate().getLicenses().stream()
.filter(e -> !Objects.equals(e, license))
.collect(Collectors.toList())));
license.childrenTracking = null;
}
@Nonnull
public List getDevelopers() {
return new WrapperList(
() -> getDelegate().getDevelopers(), l -> update(getDelegate().withDevelopers(l)),
d -> new Developer(d, this), Developer::getDelegate);
}
public void setDevelopers(List developers) {
if (developers == null) {
developers = Collections.emptyList();
}
if (!Objects.equals(developers, getDevelopers())) {
update(getDelegate().withDevelopers(
developers.stream().map(c -> c.getDelegate()).collect(Collectors.toList())));
developers.forEach(e -> e.childrenTracking = this::replace);
}
}
public void addDeveloper(Developer developer) {
update(getDelegate().withDevelopers(
Stream.concat(getDelegate().getDevelopers().stream(), Stream.of(developer.getDelegate()))
.collect(Collectors.toList())));
developer.childrenTracking = this::replace;
}
public void removeDeveloper(Developer developer) {
update(getDelegate().withDevelopers(
getDelegate().getDevelopers().stream()
.filter(e -> !Objects.equals(e, developer))
.collect(Collectors.toList())));
developer.childrenTracking = null;
}
@Nonnull
public List getContributors() {
return new WrapperList(
() -> getDelegate().getContributors(), l -> update(getDelegate().withContributors(l)),
d -> new Contributor(d, this), Contributor::getDelegate);
}
public void setContributors(List contributors) {
if (contributors == null) {
contributors = Collections.emptyList();
}
if (!Objects.equals(contributors, getContributors())) {
update(getDelegate().withContributors(
contributors.stream().map(c -> c.getDelegate()).collect(Collectors.toList())));
contributors.forEach(e -> e.childrenTracking = this::replace);
}
}
public void addContributor(Contributor contributor) {
update(getDelegate().withContributors(
Stream.concat(getDelegate().getContributors().stream(), Stream.of(contributor.getDelegate()))
.collect(Collectors.toList())));
contributor.childrenTracking = this::replace;
}
public void removeContributor(Contributor contributor) {
update(getDelegate().withContributors(
getDelegate().getContributors().stream()
.filter(e -> !Objects.equals(e, contributor))
.collect(Collectors.toList())));
contributor.childrenTracking = null;
}
@Nonnull
public List getMailingLists() {
return new WrapperList(
() -> getDelegate().getMailingLists(), l -> update(getDelegate().withMailingLists(l)),
d -> new MailingList(d, this), MailingList::getDelegate);
}
public void setMailingLists(List mailingLists) {
if (mailingLists == null) {
mailingLists = Collections.emptyList();
}
if (!Objects.equals(mailingLists, getMailingLists())) {
update(getDelegate().withMailingLists(
mailingLists.stream().map(c -> c.getDelegate()).collect(Collectors.toList())));
mailingLists.forEach(e -> e.childrenTracking = this::replace);
}
}
public void addMailingList(MailingList mailingList) {
update(getDelegate().withMailingLists(
Stream.concat(getDelegate().getMailingLists().stream(), Stream.of(mailingList.getDelegate()))
.collect(Collectors.toList())));
mailingList.childrenTracking = this::replace;
}
public void removeMailingList(MailingList mailingList) {
update(getDelegate().withMailingLists(
getDelegate().getMailingLists().stream()
.filter(e -> !Objects.equals(e, mailingList))
.collect(Collectors.toList())));
mailingList.childrenTracking = null;
}
public Prerequisites getPrerequisites() {
return getDelegate().getPrerequisites() != null ? new Prerequisites(getDelegate().getPrerequisites(), this) : null;
}
public void setPrerequisites(Prerequisites prerequisites) {
if (!Objects.equals(prerequisites, getPrerequisites())){
if (prerequisites != null) {
update(getDelegate().withPrerequisites(prerequisites.getDelegate()));
prerequisites.childrenTracking = this::replace;
} else {
update(getDelegate().withPrerequisites(null));
}
}
}
public Scm getScm() {
return getDelegate().getScm() != null ? new Scm(getDelegate().getScm(), this) : null;
}
public void setScm(Scm scm) {
if (!Objects.equals(scm, getScm())){
if (scm != null) {
update(getDelegate().withScm(scm.getDelegate()));
scm.childrenTracking = this::replace;
} else {
update(getDelegate().withScm(null));
}
}
}
public IssueManagement getIssueManagement() {
return getDelegate().getIssueManagement() != null ? new IssueManagement(getDelegate().getIssueManagement(), this) : null;
}
public void setIssueManagement(IssueManagement issueManagement) {
if (!Objects.equals(issueManagement, getIssueManagement())){
if (issueManagement != null) {
update(getDelegate().withIssueManagement(issueManagement.getDelegate()));
issueManagement.childrenTracking = this::replace;
} else {
update(getDelegate().withIssueManagement(null));
}
}
}
public CiManagement getCiManagement() {
return getDelegate().getCiManagement() != null ? new CiManagement(getDelegate().getCiManagement(), this) : null;
}
public void setCiManagement(CiManagement ciManagement) {
if (!Objects.equals(ciManagement, getCiManagement())){
if (ciManagement != null) {
update(getDelegate().withCiManagement(ciManagement.getDelegate()));
ciManagement.childrenTracking = this::replace;
} else {
update(getDelegate().withCiManagement(null));
}
}
}
public Build getBuild() {
return getDelegate().getBuild() != null ? new Build(getDelegate().getBuild(), this) : null;
}
public void setBuild(Build build) {
if (!Objects.equals(build, getBuild())){
if (build != null) {
update(getDelegate().withBuild(build.getDelegate()));
build.childrenTracking = this::replace;
} else {
update(getDelegate().withBuild(null));
}
}
}
@Nonnull
public List getProfiles() {
return new WrapperList(
() -> getDelegate().getProfiles(), l -> update(getDelegate().withProfiles(l)),
d -> new Profile(d, this), Profile::getDelegate);
}
public void setProfiles(List profiles) {
if (profiles == null) {
profiles = Collections.emptyList();
}
if (!Objects.equals(profiles, getProfiles())) {
update(getDelegate().withProfiles(
profiles.stream().map(c -> c.getDelegate()).collect(Collectors.toList())));
profiles.forEach(e -> e.childrenTracking = this::replace);
}
}
public void addProfile(Profile profile) {
update(getDelegate().withProfiles(
Stream.concat(getDelegate().getProfiles().stream(), Stream.of(profile.getDelegate()))
.collect(Collectors.toList())));
profile.childrenTracking = this::replace;
}
public void removeProfile(Profile profile) {
update(getDelegate().withProfiles(
getDelegate().getProfiles().stream()
.filter(e -> !Objects.equals(e, profile))
.collect(Collectors.toList())));
profile.childrenTracking = null;
}
public InputLocation getLocation(Object key) {
org.apache.maven.api.model.InputLocation loc = getDelegate().getLocation(key);
return loc != null ? new InputLocation(loc) : null;
}
public void setLocation(Object key, InputLocation location) {
update(org.apache.maven.api.model.Model.newBuilder(getDelegate(), true)
.location(key, location.toApiLocation()).build());
}
public InputLocation getImportedFrom() {
org.apache.maven.api.model.InputLocation loc = getDelegate().getImportedFrom();
return loc != null ? new InputLocation(loc) : null;
}
public void setImportedFrom(InputLocation location) {
update(org.apache.maven.api.model.Model.newBuilder(getDelegate(), true)
.importedFrom(location.toApiLocation()).build());
}
public Set
© 2015 - 2025 Weber Informatics LLC | Privacy Policy