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