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