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

org.apache.maven.settings.TrackableBase 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.settings;

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 TrackableBase
    extends BaseObject
{

    public TrackableBase() {
        this(org.apache.maven.api.settings.TrackableBase.newInstance());
    }

    public TrackableBase(org.apache.maven.api.settings.TrackableBase delegate) {
        this(delegate, null);
    }

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

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

    public org.apache.maven.api.settings.TrackableBase getDelegate() {
        return (org.apache.maven.api.settings.TrackableBase) super.getDelegate();
    }

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

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

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

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

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


    public static final String USER_LEVEL = "user-level";
    public static final String PROJECT_LEVEL = "project-level";
    public static final String GLOBAL_LEVEL = "global-level";

    private String sourceLevel = USER_LEVEL;
    private boolean sourceLevelSet = false;

    public void setSourceLevel(String sourceLevel) {
        if (sourceLevelSet) {
            throw new IllegalStateException("Cannot reset sourceLevel attribute; it is already set to: " + sourceLevel);
        } else if (!(USER_LEVEL.equals(sourceLevel) || PROJECT_LEVEL.equals(sourceLevel)  || GLOBAL_LEVEL.equals(sourceLevel))) {
            throw new IllegalArgumentException("sourceLevel must be one of: {" + USER_LEVEL + "," + PROJECT_LEVEL + "," + GLOBAL_LEVEL + "}");
        } else {
            this.sourceLevel = sourceLevel;
            this.sourceLevelSet = true;
        }
    }

    public String getSourceLevel() {
        return sourceLevel;
    }
          
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy