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