View Javadoc
1   // =================== DO NOT EDIT THIS FILE ====================
2   //  Generated by Modello Velocity from model-v3.vm
3   //  template, any modifications will be overwritten.
4   // ==============================================================
5   package org.apache.maven.settings;
6   
7   import java.io.Serializable;
8   import java.util.AbstractList;
9   import java.util.Collections;
10  import java.util.HashMap;
11  import java.util.List;
12  import java.util.Map;
13  import java.util.Objects;
14  import java.util.Set;
15  import java.util.stream.Collectors;
16  import java.util.stream.Stream;
17  import org.apache.maven.api.annotations.Generated;
18  import org.apache.maven.api.annotations.Nonnull;
19  
20  @Generated
21  public class TrackableBase
22      extends BaseObject
23  {
24  
25      public TrackableBase() {
26          this(org.apache.maven.api.settings.TrackableBase.newInstance());
27      }
28  
29      public TrackableBase(org.apache.maven.api.settings.TrackableBase delegate) {
30          this(delegate, null);
31      }
32  
33      public TrackableBase(org.apache.maven.api.settings.TrackableBase delegate, BaseObject parent) {
34          super(delegate, parent);
35      }
36  
37      public TrackableBase clone(){
38          return new TrackableBase(getDelegate());
39      }
40  
41      public org.apache.maven.api.settings.TrackableBase getDelegate() {
42          return (org.apache.maven.api.settings.TrackableBase) super.getDelegate();
43      }
44  
45      @Override
46      public boolean equals(Object o) {
47          if (this == o) {
48              return true;
49          }
50          if (o == null || !(o instanceof TrackableBase)) {
51              return false;
52          }
53          TrackableBase that = (TrackableBase) o;
54          return Objects.equals(this.delegate, that.delegate);
55      }
56  
57      @Override
58      public int hashCode() {
59          return getDelegate().hashCode();
60      }
61  
62      protected boolean replace(Object oldDelegate, Object newDelegate) {
63          if (super.replace(oldDelegate, newDelegate)) {
64              return true;
65          }
66          return false;
67      }
68  
69      public static List<org.apache.maven.api.settings.TrackableBase> trackableBaseToApiV4(List<TrackableBase> list) {
70          return list != null ? new WrapperList<>(list, TrackableBase::getDelegate, TrackableBase::new) : null;
71      }
72  
73      public static List<TrackableBase> trackableBaseToApiV3(List<org.apache.maven.api.settings.TrackableBase> list) {
74          return list != null ? new WrapperList<>(list, TrackableBase::new, TrackableBase::getDelegate) : null;
75      }
76  
77  
78      public static final String USER_LEVEL = "user-level";
79      public static final String PROJECT_LEVEL = "project-level";
80      public static final String GLOBAL_LEVEL = "global-level";
81  
82      private String sourceLevel = USER_LEVEL;
83      private boolean sourceLevelSet = false;
84  
85      public void setSourceLevel(String sourceLevel) {
86          if (sourceLevelSet) {
87              throw new IllegalStateException("Cannot reset sourceLevel attribute; it is already set to: " + sourceLevel);
88          } else if (!(USER_LEVEL.equals(sourceLevel) || PROJECT_LEVEL.equals(sourceLevel)  || GLOBAL_LEVEL.equals(sourceLevel))) {
89              throw new IllegalArgumentException("sourceLevel must be one of: {" + USER_LEVEL + "," + PROJECT_LEVEL + "," + GLOBAL_LEVEL + "}");
90          } else {
91              this.sourceLevel = sourceLevel;
92              this.sourceLevelSet = true;
93          }
94      }
95  
96      public String getSourceLevel() {
97          return sourceLevel;
98      }
99            
100 }