Skip to content

Commit 3e0a30e

Browse files
Kubernetes Prow Robotyue9944882
authored andcommitted
Automated openapi generation from release-1.27
Signed-off-by: Kubernetes Prow Robot <[email protected]>
1 parent 5fbd97a commit 3e0a30e

File tree

2,602 files changed

+259718
-307622
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

2,602 files changed

+259718
-307622
lines changed

fluent/src/main/java/io/kubernetes/client/fluent/BaseFluent.java

Lines changed: 37 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -25,14 +25,19 @@ public static <T>VisitableBuilder<T,?> builderOf(T item) {
2525
}
2626

2727
try {
28-
return (VisitableBuilder<T, ?>) Class.forName(item.getClass().getName() + "Builder").getConstructor(item.getClass())
28+
return (VisitableBuilder<T, ?>) Class.forName(item.getClass().getName() + "Builder", true, item.getClass().getClassLoader()).getConstructor(item.getClass())
2929
.newInstance(item);
3030
} catch (Exception e) {
31-
throw new IllegalStateException("Failed to create builder for: " + item.getClass(), e);
31+
try {
32+
return (VisitableBuilder<T, ?>) Class.forName(item.getClass().getName() + "Builder").getConstructor(item.getClass())
33+
.newInstance(item);
34+
} catch (Exception e1) {
35+
throw new IllegalStateException("Failed to create builder for: " + item.getClass(), e1);
36+
}
3237
}
3338
}
3439
public static <T>List<T> build(List<? extends io.kubernetes.client.fluent.Builder<? extends T>> list) {
35-
return list == null ? null : new ArrayList<T>(list.stream().map(Builder::build).collect(Collectors.toList()));
40+
return list == null ? null : list.stream().map(Builder::build).collect(Collectors.toList());
3641
}
3742
public static <T>Set<T> build(Set<? extends io.kubernetes.client.fluent.Builder<? extends T>> set) {
3843
return set == null ? null : new LinkedHashSet<T>(set.stream().map(Builder::build).collect(Collectors.toSet()));
@@ -68,30 +73,40 @@ public F accept(List<Entry<String,Object>> path,io.kubernetes.client.fluent.Visi
6873
return accept(path, "", visitors);
6974
}
7075
public F accept(List<Entry<String,Object>> path,String currentKey,io.kubernetes.client.fluent.Visitor... visitors) {
71-
Arrays.stream(visitors)
72-
.map(v -> VisitorListener.wrap(v))
73-
.filter(v -> ((Visitor) v).canVisit(path, this))
74-
.sorted((l, r) -> ((Visitor) r).order() - ((Visitor) l).order())
75-
.forEach(v -> {
76-
((Visitor) v).visit(path, this);
77-
});
76+
List<Visitor> sortedVisitor = new ArrayList<>();
77+
for (Visitor visitor : visitors) {
78+
visitor = VisitorListener.wrap(visitor);
79+
if (!visitor.canVisit(path, this)) {
80+
continue;
81+
}
82+
sortedVisitor.add(visitor);
83+
}
84+
sortedVisitor.sort((l, r) -> ((Visitor) r).order() - ((Visitor) l).order());
85+
for (Visitor visitor : sortedVisitor) {
86+
visitor.visit(path, this);
87+
}
7888

7989
List<Entry<String, Object>> copyOfPath = path != null ? new ArrayList(path) : new ArrayList<>();
80-
copyOfPath.add(new AbstractMap.SimpleEntry<String, Object>(currentKey, this));
90+
copyOfPath.add(new AbstractMap.SimpleEntry<>(currentKey, this));
8191

82-
_visitables.forEach((key, visitables) -> {
92+
for (Entry<String, ?> entry : _visitables.entrySet()) {
8393
List<Entry<String, Object>> newPath = Collections.unmodifiableList(copyOfPath);
84-
// Copy visitables to avoid ConcurrrentModificationException when Visitors add/remove Visitables
85-
new ArrayList<>(visitables).forEach(visitable -> {
86-
Arrays.stream(visitors)
87-
.filter(v -> v.getType() != null && v.getType().isAssignableFrom(visitable.getClass()))
88-
.forEach(v -> visitable.accept(newPath, key, v));
8994

90-
Arrays.stream(visitors)
91-
.filter(v -> v.getType() == null || !v.getType().isAssignableFrom(visitable.getClass()))
92-
.forEach(v -> visitable.accept(newPath, key, v));
93-
});
94-
});
95+
// Copy visitables to avoid ConcurrentModificationException when Visitors add/remove Visitables
96+
for (Visitable<F> visitable : new ArrayList<>((List<Visitable<F>>) entry.getValue())) {
97+
for (Visitor visitor : visitors) {
98+
if (visitor.getType() != null && visitor.getType().isAssignableFrom(visitable.getClass())) {
99+
visitable.accept(newPath, entry.getKey(), visitor);
100+
}
101+
}
102+
103+
for (Visitor visitor : visitors) {
104+
if (visitor.getType() == null || !visitor.getType().isAssignableFrom(visitable.getClass())) {
105+
visitable.accept(newPath, entry.getKey(), visitor);
106+
}
107+
}
108+
}
109+
}
95110
return (F) this;
96111
}
97112
public int hashCode() {

fluent/src/main/java/io/kubernetes/client/fluent/VisitorWiretap.java

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,21 +26,32 @@ public Class<T> getType() {
2626
return delegate.getType();
2727
}
2828
public void visit(T target) {
29-
listeners.forEach(l -> l.beforeVisit(delegate, Collections.emptyList(), target));
29+
for (VisitorListener l : listeners) {
30+
l.beforeVisit(delegate, Collections.emptyList(), target);
31+
}
3032
delegate.visit(target);
31-
listeners.forEach(l -> l.afterVisit(delegate, Collections.emptyList(), target));
33+
for (VisitorListener l : listeners) {
34+
l.afterVisit(delegate, Collections.emptyList(), target);
35+
}
3236
}
3337
public int order() {
3438
return delegate.order();
3539
}
3640
public void visit(List<Entry<String,Object>> path,T target) {
37-
listeners.forEach(l -> l.beforeVisit(delegate, path, target));
41+
for (VisitorListener l : listeners) {
42+
l.beforeVisit(delegate, path, target);
43+
}
3844
delegate.visit(path, target);
39-
listeners.forEach(l -> l.afterVisit(delegate, path, target));
45+
for (VisitorListener l : listeners) {
46+
l.afterVisit(delegate, path, target);
47+
}
4048
}
4149
public <F>Boolean canVisit(List<Entry<String,Object>> path,F target) {
4250
boolean canVisit = delegate.canVisit(path, target);
43-
listeners.forEach(l -> l.onCheck(delegate, canVisit, target));
51+
for (VisitorListener l : listeners) {
52+
l.onCheck(delegate, canVisit, target);
53+
}
54+
4455
return canVisit;
4556
}
4657

fluent/src/main/java/io/kubernetes/client/openapi/models/AdmissionregistrationV1ServiceReferenceBuilder.java

Lines changed: 12 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -20,29 +20,25 @@ public AdmissionregistrationV1ServiceReferenceBuilder(AdmissionregistrationV1Ser
2020
}
2121
public AdmissionregistrationV1ServiceReferenceBuilder(AdmissionregistrationV1ServiceReferenceFluent<?> fluent,AdmissionregistrationV1ServiceReference instance,Boolean validationEnabled) {
2222
this.fluent = fluent;
23-
fluent.withName(instance.getName());
24-
25-
fluent.withNamespace(instance.getNamespace());
26-
27-
fluent.withPath(instance.getPath());
28-
29-
fluent.withPort(instance.getPort());
30-
23+
if (instance != null) {
24+
fluent.withName(instance.getName());
25+
fluent.withNamespace(instance.getNamespace());
26+
fluent.withPath(instance.getPath());
27+
fluent.withPort(instance.getPort());
28+
}
3129
this.validationEnabled = validationEnabled;
3230
}
3331
public AdmissionregistrationV1ServiceReferenceBuilder(AdmissionregistrationV1ServiceReference instance) {
3432
this(instance,false);
3533
}
3634
public AdmissionregistrationV1ServiceReferenceBuilder(AdmissionregistrationV1ServiceReference instance,Boolean validationEnabled) {
3735
this.fluent = this;
38-
this.withName(instance.getName());
39-
40-
this.withNamespace(instance.getNamespace());
41-
42-
this.withPath(instance.getPath());
43-
44-
this.withPort(instance.getPort());
45-
36+
if (instance != null) {
37+
this.withName(instance.getName());
38+
this.withNamespace(instance.getNamespace());
39+
this.withPath(instance.getPath());
40+
this.withPort(instance.getPort());
41+
}
4642
this.validationEnabled = validationEnabled;
4743
}
4844
AdmissionregistrationV1ServiceReferenceFluent<?> fluent;

fluent/src/main/java/io/kubernetes/client/openapi/models/AdmissionregistrationV1ServiceReferenceFluent.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package io.kubernetes.client.openapi.models;
22

33
import java.lang.Integer;
4+
import com.google.gson.annotations.SerializedName;
45
import io.kubernetes.client.fluent.Fluent;
56
import java.lang.String;
67
import java.lang.Boolean;

fluent/src/main/java/io/kubernetes/client/openapi/models/AdmissionregistrationV1ServiceReferenceFluentImpl.java

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,12 @@ public class AdmissionregistrationV1ServiceReferenceFluentImpl<A extends Admissi
1515
public AdmissionregistrationV1ServiceReferenceFluentImpl() {
1616
}
1717
public AdmissionregistrationV1ServiceReferenceFluentImpl(AdmissionregistrationV1ServiceReference instance) {
18-
this.withName(instance.getName());
19-
20-
this.withNamespace(instance.getNamespace());
21-
22-
this.withPath(instance.getPath());
23-
24-
this.withPort(instance.getPort());
25-
18+
if (instance != null) {
19+
this.withName(instance.getName());
20+
this.withNamespace(instance.getNamespace());
21+
this.withPath(instance.getPath());
22+
this.withPort(instance.getPort());
23+
}
2624
}
2725
private String name;
2826
private String namespace;
@@ -67,11 +65,16 @@ public Boolean hasPort() {
6765
public boolean equals(Object o) {
6866
if (this == o) return true;
6967
if (o == null || getClass() != o.getClass()) return false;
68+
if (!super.equals(o)) return false;
7069
AdmissionregistrationV1ServiceReferenceFluentImpl that = (AdmissionregistrationV1ServiceReferenceFluentImpl) o;
71-
if (name != null ? !name.equals(that.name) :that.name != null) return false;
72-
if (namespace != null ? !namespace.equals(that.namespace) :that.namespace != null) return false;
73-
if (path != null ? !path.equals(that.path) :that.path != null) return false;
74-
if (port != null ? !port.equals(that.port) :that.port != null) return false;
70+
if (!java.util.Objects.equals(name, that.name)) return false;
71+
72+
if (!java.util.Objects.equals(namespace, that.namespace)) return false;
73+
74+
if (!java.util.Objects.equals(path, that.path)) return false;
75+
76+
if (!java.util.Objects.equals(port, that.port)) return false;
77+
7578
return true;
7679
}
7780
public int hashCode() {

fluent/src/main/java/io/kubernetes/client/openapi/models/AdmissionregistrationV1WebhookClientConfigBuilder.java

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -20,25 +20,23 @@ public AdmissionregistrationV1WebhookClientConfigBuilder(AdmissionregistrationV1
2020
}
2121
public AdmissionregistrationV1WebhookClientConfigBuilder(AdmissionregistrationV1WebhookClientConfigFluent<?> fluent,AdmissionregistrationV1WebhookClientConfig instance,Boolean validationEnabled) {
2222
this.fluent = fluent;
23-
fluent.withCaBundle(instance.getCaBundle());
24-
25-
fluent.withService(instance.getService());
26-
27-
fluent.withUrl(instance.getUrl());
28-
23+
if (instance != null) {
24+
fluent.withCaBundle(instance.getCaBundle());
25+
fluent.withService(instance.getService());
26+
fluent.withUrl(instance.getUrl());
27+
}
2928
this.validationEnabled = validationEnabled;
3029
}
3130
public AdmissionregistrationV1WebhookClientConfigBuilder(AdmissionregistrationV1WebhookClientConfig instance) {
3231
this(instance,false);
3332
}
3433
public AdmissionregistrationV1WebhookClientConfigBuilder(AdmissionregistrationV1WebhookClientConfig instance,Boolean validationEnabled) {
3534
this.fluent = this;
36-
this.withCaBundle(instance.getCaBundle());
37-
38-
this.withService(instance.getService());
39-
40-
this.withUrl(instance.getUrl());
41-
35+
if (instance != null) {
36+
this.withCaBundle(instance.getCaBundle());
37+
this.withService(instance.getService());
38+
this.withUrl(instance.getUrl());
39+
}
4240
this.validationEnabled = validationEnabled;
4341
}
4442
AdmissionregistrationV1WebhookClientConfigFluent<?> fluent;

fluent/src/main/java/io/kubernetes/client/openapi/models/AdmissionregistrationV1WebhookClientConfigFluent.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
package io.kubernetes.client.openapi.models;
22

3+
import com.google.gson.annotations.SerializedName;
34
import io.kubernetes.client.fluent.Fluent;
45
import io.kubernetes.client.fluent.Nested;
56
import java.util.ArrayList;
67
import java.lang.String;
7-
import java.lang.Integer;
88
import java.lang.Deprecated;
99
import java.lang.Byte;
1010
import java.util.Collection;
@@ -16,8 +16,8 @@
1616
public interface AdmissionregistrationV1WebhookClientConfigFluent<A extends AdmissionregistrationV1WebhookClientConfigFluent<A>> extends Fluent<A>{
1717
public A withCaBundle(byte... caBundle);
1818
public byte[] getCaBundle();
19-
public A addToCaBundle(Integer index,Byte item);
20-
public A setToCaBundle(Integer index,Byte item);
19+
public A addToCaBundle(int index,Byte item);
20+
public A setToCaBundle(int index,Byte item);
2121
public A addToCaBundle(java.lang.Byte... items);
2222
public A addAllToCaBundle(Collection<Byte> items);
2323
public A removeFromCaBundle(java.lang.Byte... items);

fluent/src/main/java/io/kubernetes/client/openapi/models/AdmissionregistrationV1WebhookClientConfigFluentImpl.java

Lines changed: 21 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
import io.kubernetes.client.fluent.Nested;
55
import java.util.ArrayList;
66
import java.lang.String;
7-
import java.lang.Integer;
87
import java.lang.Deprecated;
98
import java.lang.Byte;
109
import io.kubernetes.client.fluent.BaseFluent;
@@ -21,18 +20,17 @@ public class AdmissionregistrationV1WebhookClientConfigFluentImpl<A extends Admi
2120
public AdmissionregistrationV1WebhookClientConfigFluentImpl() {
2221
}
2322
public AdmissionregistrationV1WebhookClientConfigFluentImpl(AdmissionregistrationV1WebhookClientConfig instance) {
24-
this.withCaBundle(instance.getCaBundle());
25-
26-
this.withService(instance.getService());
27-
28-
this.withUrl(instance.getUrl());
29-
23+
if (instance != null) {
24+
this.withCaBundle(instance.getCaBundle());
25+
this.withService(instance.getService());
26+
this.withUrl(instance.getUrl());
27+
}
3028
}
3129
private List<Byte> caBundle;
3230
private AdmissionregistrationV1ServiceReferenceBuilder service;
3331
private String url;
3432
public A withCaBundle(byte... caBundle) {
35-
if (this.caBundle != null) {this.caBundle.clear();}
33+
if (this.caBundle != null) {this.caBundle.clear(); _visitables.remove("caBundle"); }
3634
if (caBundle != null) {for (byte item :caBundle){ this.addToCaBundle(item);}} return (A) this;
3735
}
3836
public byte[] getCaBundle() {
@@ -49,12 +47,12 @@ public byte[] getCaBundle() {
4947
return result;
5048

5149
}
52-
public A addToCaBundle(Integer index,Byte item) {
50+
public A addToCaBundle(int index,Byte item) {
5351
if (this.caBundle == null) {this.caBundle = new ArrayList<Byte>();}
5452
this.caBundle.add(index, item);
5553
return (A)this;
5654
}
57-
public A setToCaBundle(Integer index,Byte item) {
55+
public A setToCaBundle(int index,Byte item) {
5856
if (this.caBundle == null) {this.caBundle = new ArrayList<Byte>();}
5957
this.caBundle.set(index, item); return (A)this;
6058
}
@@ -94,19 +92,19 @@ public A withService(AdmissionregistrationV1ServiceReference service) {
9492
public Boolean hasService() {
9593
return this.service != null;
9694
}
97-
public AdmissionregistrationV1WebhookClientConfigFluent.ServiceNested<A> withNewService() {
95+
public AdmissionregistrationV1WebhookClientConfigFluentImpl.ServiceNested<A> withNewService() {
9896
return new AdmissionregistrationV1WebhookClientConfigFluentImpl.ServiceNestedImpl();
9997
}
100-
public AdmissionregistrationV1WebhookClientConfigFluent.ServiceNested<A> withNewServiceLike(AdmissionregistrationV1ServiceReference item) {
98+
public AdmissionregistrationV1WebhookClientConfigFluentImpl.ServiceNested<A> withNewServiceLike(AdmissionregistrationV1ServiceReference item) {
10199
return new AdmissionregistrationV1WebhookClientConfigFluentImpl.ServiceNestedImpl(item);
102100
}
103-
public AdmissionregistrationV1WebhookClientConfigFluent.ServiceNested<A> editService() {
101+
public AdmissionregistrationV1WebhookClientConfigFluentImpl.ServiceNested<A> editService() {
104102
return withNewServiceLike(getService());
105103
}
106-
public AdmissionregistrationV1WebhookClientConfigFluent.ServiceNested<A> editOrNewService() {
104+
public AdmissionregistrationV1WebhookClientConfigFluentImpl.ServiceNested<A> editOrNewService() {
107105
return withNewServiceLike(getService() != null ? getService(): new AdmissionregistrationV1ServiceReferenceBuilder().build());
108106
}
109-
public AdmissionregistrationV1WebhookClientConfigFluent.ServiceNested<A> editOrNewServiceLike(AdmissionregistrationV1ServiceReference item) {
107+
public AdmissionregistrationV1WebhookClientConfigFluentImpl.ServiceNested<A> editOrNewServiceLike(AdmissionregistrationV1ServiceReference item) {
110108
return withNewServiceLike(getService() != null ? getService(): item);
111109
}
112110
public String getUrl() {
@@ -121,10 +119,14 @@ public Boolean hasUrl() {
121119
public boolean equals(Object o) {
122120
if (this == o) return true;
123121
if (o == null || getClass() != o.getClass()) return false;
122+
if (!super.equals(o)) return false;
124123
AdmissionregistrationV1WebhookClientConfigFluentImpl that = (AdmissionregistrationV1WebhookClientConfigFluentImpl) o;
125-
if (caBundle != null ? !caBundle.equals(that.caBundle) :that.caBundle != null) return false;
126-
if (service != null ? !service.equals(that.service) :that.service != null) return false;
127-
if (url != null ? !url.equals(that.url) :that.url != null) return false;
124+
if (!java.util.Objects.equals(caBundle, that.caBundle)) return false;
125+
126+
if (!java.util.Objects.equals(service, that.service)) return false;
127+
128+
if (!java.util.Objects.equals(url, that.url)) return false;
129+
128130
return true;
129131
}
130132
public int hashCode() {
@@ -139,7 +141,7 @@ public String toString() {
139141
sb.append("}");
140142
return sb.toString();
141143
}
142-
class ServiceNestedImpl<N> extends AdmissionregistrationV1ServiceReferenceFluentImpl<AdmissionregistrationV1WebhookClientConfigFluent.ServiceNested<N>> implements AdmissionregistrationV1WebhookClientConfigFluent.ServiceNested<N>,Nested<N>{
144+
class ServiceNestedImpl<N> extends AdmissionregistrationV1ServiceReferenceFluentImpl<AdmissionregistrationV1WebhookClientConfigFluentImpl.ServiceNested<N>> implements AdmissionregistrationV1WebhookClientConfigFluentImpl.ServiceNested<N>,Nested<N>{
143145
ServiceNestedImpl(AdmissionregistrationV1ServiceReference item) {
144146
this.builder = new AdmissionregistrationV1ServiceReferenceBuilder(this, item);
145147
}

0 commit comments

Comments
 (0)