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