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.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 DeploymentRepository
21      extends Repository
22      implements Serializable, Cloneable
23  {
24  
25      public DeploymentRepository()
26      {
27          this( org.apache.maven.api.model.DeploymentRepository.newInstance() );
28      }
29  
30      public DeploymentRepository( org.apache.maven.api.model.DeploymentRepository delegate )
31      {
32          this( delegate, null );
33      }
34  
35      public DeploymentRepository( org.apache.maven.api.model.DeploymentRepository delegate, BaseObject parent )
36      {
37          super( delegate, parent );
38      }
39  
40      public DeploymentRepository clone()
41      {
42          return new DeploymentRepository( getDelegate() );
43      }
44  
45      @Override
46      public org.apache.maven.api.model.DeploymentRepository getDelegate()
47      {
48          return ( org.apache.maven.api.model.DeploymentRepository ) super.getDelegate();
49      }
50  
51      @Override
52      public boolean equals( Object o )
53      {
54          if ( this == o )
55          {
56              return true;
57          }
58          if ( o == null || !( o instanceof DeploymentRepository ) )
59          {
60              return false;
61          }
62          DeploymentRepository that = ( DeploymentRepository ) o;
63          return Objects.equals( this.delegate, that.delegate );
64      }
65  
66      @Override
67      public int hashCode()
68      {
69          return getDelegate().hashCode();
70      }
71  
72      public boolean isUniqueVersion()
73      {
74          return getDelegate().isUniqueVersion();
75      }
76  
77      public void setUniqueVersion( boolean uniqueVersion )
78      {
79          if ( !Objects.equals( uniqueVersion, getDelegate().isUniqueVersion() ) )
80          {
81              update( getDelegate().withUniqueVersion( uniqueVersion ) );
82          }
83      }
84  
85      public InputLocation getLocation( Object key )
86      {
87          org.apache.maven.api.model.InputLocation loc = getDelegate().getLocation( key );
88          return loc != null ? new InputLocation( loc ) : null;
89      }
90  
91      public void setLocation( Object key, InputLocation location )
92      {
93          update( org.apache.maven.api.model.DeploymentRepository.newBuilder( getDelegate(), true )
94                          .location( key, location.toApiLocation() ).build() );
95      }
96  
97      protected boolean replace( Object oldDelegate, Object newDelegate )
98      {
99          if ( super.replace( oldDelegate, newDelegate ) )
100         {
101             return true;
102         }
103         return false;
104     }
105 
106     public static List<org.apache.maven.api.model.DeploymentRepository> deploymentRepositoryToApiV4( List<DeploymentRepository> list )
107     {
108         return list != null ? new WrapperList<>( list, DeploymentRepository::getDelegate, DeploymentRepository::new ) : null;
109     }
110 
111     public static List<DeploymentRepository> deploymentRepositoryToApiV3( List<org.apache.maven.api.model.DeploymentRepository> list )
112     {
113         return list != null ? new WrapperList<>( list, DeploymentRepository::new, DeploymentRepository::getDelegate ) : null;
114     }
115 
116 }