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.toolchain.model;
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      {
26          this( org.apache.maven.api.toolchain.TrackableBase.newInstance() );
27      }
28  
29      public TrackableBase( org.apache.maven.api.toolchain.TrackableBase delegate )
30      {
31          this( delegate, null );
32      }
33  
34      public TrackableBase( org.apache.maven.api.toolchain.TrackableBase delegate, BaseObject parent )
35      {
36          super( delegate, parent );
37      }
38  
39      public TrackableBase clone()
40      {
41          return new TrackableBase( getDelegate() );
42      }
43  
44      public org.apache.maven.api.toolchain.TrackableBase getDelegate()
45      {
46          return ( org.apache.maven.api.toolchain.TrackableBase ) super.getDelegate();
47      }
48  
49      @Override
50      public boolean equals( Object o )
51      {
52          if ( this == o )
53          {
54              return true;
55          }
56          if ( o == null || !( o instanceof TrackableBase ) )
57          {
58              return false;
59          }
60          TrackableBase that = ( TrackableBase ) o;
61          return Objects.equals( this.delegate, that.delegate );
62      }
63  
64      @Override
65      public int hashCode()
66      {
67          return getDelegate().hashCode();
68      }
69  
70      protected boolean replace( Object oldDelegate, Object newDelegate )
71      {
72          if ( super.replace( oldDelegate, newDelegate ) )
73          {
74              return true;
75          }
76          return false;
77      }
78  
79      public static List<org.apache.maven.api.toolchain.TrackableBase> trackableBaseToApiV4( List<TrackableBase> list )
80      {
81          return list != null ? new WrapperList<>( list, TrackableBase::getDelegate, TrackableBase::new ) : null;
82      }
83  
84      public static List<TrackableBase> trackableBaseToApiV3( List<org.apache.maven.api.toolchain.TrackableBase> list )
85      {
86          return list != null ? new WrapperList<>( list, TrackableBase::new, TrackableBase::getDelegate ) : null;
87      }
88  
89  
90                  
91          public static final String USER_LEVEL = "user-level";
92          public static final String GLOBAL_LEVEL = "global-level";
93  
94          private String sourceLevel = USER_LEVEL;
95          private boolean sourceLevelSet = false;
96  
97          public void setSourceLevel( String sourceLevel )
98          {
99              if ( sourceLevelSet )
100             {
101                 throw new IllegalStateException( "Cannot reset sourceLevel attribute; it is already set to: " + sourceLevel );
102             }
103             else if ( !( USER_LEVEL.equals( sourceLevel ) || GLOBAL_LEVEL.equals( sourceLevel ) ) )
104             {
105                 throw new IllegalArgumentException( "sourceLevel must be one of: {" + USER_LEVEL + "," + GLOBAL_LEVEL + "}" );
106             }
107             else
108             {
109                 this.sourceLevel = sourceLevel;
110                 this.sourceLevelSet = true;
111             }
112         }
113 
114         public String getSourceLevel()
115         {
116             return sourceLevel;
117         }
118                 
119               
120 }