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.stream.Collectors;
15  import java.util.stream.Stream;
16  import org.apache.maven.api.annotations.Generated;
17  import org.apache.maven.api.annotations.Nonnull;
18  
19  @Generated
20  public class TrackableBase
21      extends BaseObject
22  {
23  
24      public TrackableBase() {
25          this(org.apache.maven.api.settings.TrackableBase.newInstance());
26      }
27  
28      public TrackableBase(org.apache.maven.api.settings.TrackableBase delegate) {
29          this(delegate, null);
30      }
31  
32      public TrackableBase(org.apache.maven.api.settings.TrackableBase delegate, BaseObject parent) {
33          super(delegate, parent);
34      }
35  
36      public TrackableBase clone(){
37          return new TrackableBase(getDelegate());
38      }
39  
40      public org.apache.maven.api.settings.TrackableBase getDelegate() {
41          return (org.apache.maven.api.settings.TrackableBase) super.getDelegate();
42      }
43  
44      @Override
45      public boolean equals(Object o) {
46          if (this == o) {
47              return true;
48          }
49          if (o == null || !(o instanceof TrackableBase)) {
50              return false;
51          }
52          TrackableBase that = (TrackableBase) o;
53          return Objects.equals(this.delegate, that.delegate);
54      }
55  
56      @Override
57      public int hashCode() {
58          return getDelegate().hashCode();
59      }
60  
61      protected boolean replace(Object oldDelegate, Object newDelegate) {
62          if (super.replace(oldDelegate, newDelegate)) {
63              return true;
64          }
65          return false;
66      }
67  
68      public static List<org.apache.maven.api.settings.TrackableBase> trackableBaseToApiV4(List<TrackableBase> list) {
69          return list != null ? new WrapperList<>(list, TrackableBase::getDelegate, TrackableBase::new) : null;
70      }
71  
72      public static List<TrackableBase> trackableBaseToApiV3(List<org.apache.maven.api.settings.TrackableBase> list) {
73          return list != null ? new WrapperList<>(list, TrackableBase::new, TrackableBase::getDelegate) : null;
74      }
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      {
87          if ( sourceLevelSet )
88          {
89              throw new IllegalStateException( "Cannot reset sourceLevel attribute; it is already set to: " + sourceLevel );
90          }
91          else if ( !( USER_LEVEL.equals( sourceLevel ) || PROJECT_LEVEL.equals( sourceLevel )  || GLOBAL_LEVEL.equals( sourceLevel ) ) )
92          {
93              throw new IllegalArgumentException( "sourceLevel must be one of: {" + USER_LEVEL + "," + PROJECT_LEVEL + "," + GLOBAL_LEVEL + "}" );
94          }
95          else
96          {
97              this.sourceLevel = sourceLevel;
98              this.sourceLevelSet = true;
99          }
100     }
101 
102     public String getSourceLevel()
103     {
104         return sourceLevel;
105     }
106             
107           
108 }