
org.apache.maven.model.Parent Maven / Gradle / Ivy
// =================== 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.util.AbstractList;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.stream.Collectors;
import java.util.stream.Stream;
import org.apache.maven.api.annotations.Generated;
import org.apache.maven.api.annotations.Nonnull;
@Generated
public class Parent
extends BaseObject
{
public Parent() {
this(org.apache.maven.api.model.Parent.newInstance());
}
public Parent(org.apache.maven.api.model.Parent delegate) {
this(delegate, null);
}
public Parent(org.apache.maven.api.model.Parent delegate, BaseObject parent) {
super(delegate, parent);
}
public Parent clone(){
return new Parent(getDelegate());
}
public org.apache.maven.api.model.Parent getDelegate() {
return (org.apache.maven.api.model.Parent) super.getDelegate();
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || !(o instanceof Parent)) {
return false;
}
Parent that = (Parent) o;
return Objects.equals(this.delegate, that.delegate);
}
@Override
public int hashCode() {
return getDelegate().hashCode();
}
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 getRelativePath() {
return getDelegate().getRelativePath();
}
public void setRelativePath(String relativePath) {
if (!Objects.equals(relativePath, getRelativePath())) {
update(getDelegate().withRelativePath(relativePath));
}
}
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.Parent.newBuilder(getDelegate(), true)
.location(key, location.toApiLocation()).build());
}
protected boolean replace(Object oldDelegate, Object newDelegate) {
if (super.replace(oldDelegate, newDelegate)) {
return true;
}
return false;
}
public static List parentToApiV4(List list) {
return list != null ? new WrapperList<>(list, Parent::getDelegate, Parent::new) : null;
}
public static List parentToApiV3(List list) {
return list != null ? new WrapperList<>(list, Parent::new, Parent::getDelegate) : null;
}
/**
* @return the id as {@code groupId:artifactId:version}
*/
public String getId()
{
StringBuilder id = new StringBuilder( 64 );
id.append( getGroupId() );
id.append( ":" );
id.append( getArtifactId() );
id.append( ":" );
id.append( "pom" );
id.append( ":" );
id.append( getVersion() );
return id.toString();
}
@Override
public String toString()
{
return getId();
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy