All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.apache.maven.model.Scm Maven / Gradle / Ivy

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.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.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;

@Generated
public class Scm
    extends BaseObject
{

    public Scm() {
        this(org.apache.maven.api.model.Scm.newInstance());
    }

    public Scm(org.apache.maven.api.model.Scm delegate) {
        this(delegate, null);
    }

    public Scm(org.apache.maven.api.model.Scm delegate, BaseObject parent) {
        super(delegate, parent);
    }

    public Scm clone(){
        return new Scm(getDelegate());
    }

    public org.apache.maven.api.model.Scm getDelegate() {
        return (org.apache.maven.api.model.Scm) super.getDelegate();
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) {
            return true;
        }
        if (o == null || !(o instanceof Scm)) {
            return false;
        }
        Scm that = (Scm) o;
        return Objects.equals(this.delegate, that.delegate);
    }

    @Override
    public int hashCode() {
        return getDelegate().hashCode();
    }

    public String getConnection() {
        return getDelegate().getConnection();
    }

    public void setConnection(String connection) {
        if (!Objects.equals(connection, getConnection())) {
            update(getDelegate().withConnection(connection));
        }
    }

    public String getDeveloperConnection() {
        return getDelegate().getDeveloperConnection();
    }

    public void setDeveloperConnection(String developerConnection) {
        if (!Objects.equals(developerConnection, getDeveloperConnection())) {
            update(getDelegate().withDeveloperConnection(developerConnection));
        }
    }

    public String getTag() {
        return getDelegate().getTag();
    }

    public void setTag(String tag) {
        if (!Objects.equals(tag, getTag())) {
            update(getDelegate().withTag(tag));
        }
    }

    public String getUrl() {
        return getDelegate().getUrl();
    }

    public void setUrl(String url) {
        if (!Objects.equals(url, getUrl())) {
            update(getDelegate().withUrl(url));
        }
    }

    public String getChildScmConnectionInheritAppendPath() {
        return getDelegate().getChildScmConnectionInheritAppendPath();
    }

    public void setChildScmConnectionInheritAppendPath(String childScmConnectionInheritAppendPath) {
        if (!Objects.equals(childScmConnectionInheritAppendPath, getChildScmConnectionInheritAppendPath())) {
            update(getDelegate().withChildScmConnectionInheritAppendPath(childScmConnectionInheritAppendPath));
        }
    }

    public String getChildScmDeveloperConnectionInheritAppendPath() {
        return getDelegate().getChildScmDeveloperConnectionInheritAppendPath();
    }

    public void setChildScmDeveloperConnectionInheritAppendPath(String childScmDeveloperConnectionInheritAppendPath) {
        if (!Objects.equals(childScmDeveloperConnectionInheritAppendPath, getChildScmDeveloperConnectionInheritAppendPath())) {
            update(getDelegate().withChildScmDeveloperConnectionInheritAppendPath(childScmDeveloperConnectionInheritAppendPath));
        }
    }

    public String getChildScmUrlInheritAppendPath() {
        return getDelegate().getChildScmUrlInheritAppendPath();
    }

    public void setChildScmUrlInheritAppendPath(String childScmUrlInheritAppendPath) {
        if (!Objects.equals(childScmUrlInheritAppendPath, getChildScmUrlInheritAppendPath())) {
            update(getDelegate().withChildScmUrlInheritAppendPath(childScmUrlInheritAppendPath));
        }
    }

    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.Scm.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.Scm.newBuilder(getDelegate(), true)
                        .importedFrom(location.toApiLocation()).build());
    }

    public Set getLocationKeys() {
        return getDelegate().getLocationKeys();
    }

    protected boolean replace(Object oldDelegate, Object newDelegate) {
        if (super.replace(oldDelegate, newDelegate)) {
            return true;
        }
        return false;
    }

    public static List scmToApiV4(List list) {
        return list != null ? new WrapperList<>(list, Scm::getDelegate, Scm::new) : null;
    }

    public static List scmToApiV3(List list) {
        return list != null ? new WrapperList<>(list, Scm::new, Scm::getDelegate) : null;
    }


            

    public boolean isChildScmConnectionInheritAppendPath() {
        return (getChildScmConnectionInheritAppendPath() != null) ? Boolean.parseBoolean(getChildScmConnectionInheritAppendPath()) : true;
    }

    public boolean isChildScmDeveloperConnectionInheritAppendPath() {
        return (getChildScmDeveloperConnectionInheritAppendPath() != null) ? Boolean.parseBoolean(getChildScmDeveloperConnectionInheritAppendPath()) : true;
    }

    public boolean isChildScmUrlInheritAppendPath() {
        return (getChildScmUrlInheritAppendPath() != null) ? Boolean.parseBoolean(getChildScmUrlInheritAppendPath()) : true;
    }

            
          

            
    /**
     * @see java.lang.Object#toString()
     */
    public String toString() {
        return "Scm {connection=" + getConnection() + "}";
    }
            
          
}