1
2
3
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.LinkedHashMap;
12 import java.util.List;
13 import java.util.Map;
14 import java.util.Objects;
15 import java.util.Set;
16 import java.util.stream.Collectors;
17 import java.util.stream.Stream;
18 import org.apache.maven.api.annotations.Generated;
19 import org.apache.maven.api.annotations.Nonnull;
20
21 @Generated
22 public class Mirror
23 extends IdentifiableBase
24 implements Serializable, Cloneable
25 {
26
27 public Mirror() {
28 this(org.apache.maven.api.settings.Mirror.newInstance());
29 }
30
31 public Mirror(org.apache.maven.api.settings.Mirror delegate) {
32 this(delegate, null);
33 }
34
35 public Mirror(org.apache.maven.api.settings.Mirror delegate, BaseObject parent) {
36 super(delegate, parent);
37 }
38
39 public Mirror clone(){
40 return new Mirror(getDelegate());
41 }
42
43 @Override
44 public org.apache.maven.api.settings.Mirror getDelegate() {
45 return (org.apache.maven.api.settings.Mirror) super.getDelegate();
46 }
47
48 @Override
49 public boolean equals(Object o) {
50 if (this == o) {
51 return true;
52 }
53 if (o == null || !(o instanceof Mirror)) {
54 return false;
55 }
56 Mirror that = (Mirror) o;
57 return Objects.equals(this.delegate, that.delegate);
58 }
59
60 @Override
61 public int hashCode() {
62 return getDelegate().hashCode();
63 }
64
65 public String getMirrorOf() {
66 return getDelegate().getMirrorOf();
67 }
68
69 public void setMirrorOf(String mirrorOf) {
70 if (!Objects.equals(mirrorOf, getMirrorOf())) {
71 update(getDelegate().withMirrorOf(mirrorOf));
72 }
73 }
74
75 public String getName() {
76 return getDelegate().getName();
77 }
78
79 public void setName(String name) {
80 if (!Objects.equals(name, getName())) {
81 update(getDelegate().withName(name));
82 }
83 }
84
85 public String getUrl() {
86 return getDelegate().getUrl();
87 }
88
89 public void setUrl(String url) {
90 if (!Objects.equals(url, getUrl())) {
91 update(getDelegate().withUrl(url));
92 }
93 }
94
95 public String getLayout() {
96 return getDelegate().getLayout();
97 }
98
99 public void setLayout(String layout) {
100 if (!Objects.equals(layout, getLayout())) {
101 update(getDelegate().withLayout(layout));
102 }
103 }
104
105 public String getMirrorOfLayouts() {
106 return getDelegate().getMirrorOfLayouts();
107 }
108
109 public void setMirrorOfLayouts(String mirrorOfLayouts) {
110 if (!Objects.equals(mirrorOfLayouts, getMirrorOfLayouts())) {
111 update(getDelegate().withMirrorOfLayouts(mirrorOfLayouts));
112 }
113 }
114
115 public boolean isBlocked() {
116 return getDelegate().isBlocked();
117 }
118
119 public void setBlocked(boolean blocked) {
120 if (!Objects.equals(blocked, isBlocked())) {
121 update(getDelegate().withBlocked(blocked));
122 }
123 }
124
125 protected boolean replace(Object oldDelegate, Object newDelegate) {
126 if (super.replace(oldDelegate, newDelegate)) {
127 return true;
128 }
129 return false;
130 }
131
132 public static List<org.apache.maven.api.settings.Mirror> mirrorToApiV4(List<Mirror> list) {
133 return list != null ? new WrapperList<>(list, Mirror::getDelegate, Mirror::new) : null;
134 }
135
136 public static List<Mirror> mirrorToApiV3(List<org.apache.maven.api.settings.Mirror> list) {
137 return list != null ? new WrapperList<>(list, Mirror::new, Mirror::getDelegate) : null;
138 }
139
140
141
142
143 public String toString() {
144 StringBuilder sb = new StringBuilder(128);
145 sb.append("Mirror[");
146 sb.append("id=").append(this.getId());
147 sb.append(",mirrorOf=").append(this.getMirrorOf());
148 sb.append(",url=").append(this.getUrl());
149 sb.append(",name=").append(this.getName());
150 if (isBlocked()) {
151 sb.append(",blocked");
152 }
153 sb.append("]");
154 return sb.toString();
155 }
156
157
158 }