Skip to content

Commit 8f5bc1a

Browse files
authored
Merge pull request kubernetes-client#2551 from rjeberhard/options-builder
Builder methods for *Options classes
2 parents da520d5 + 80c0a79 commit 8f5bc1a

File tree

4 files changed

+65
-0
lines changed

4 files changed

+65
-0
lines changed

util/src/main/java/io/kubernetes/client/util/generic/options/CreateOptions.java

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,11 @@ public class CreateOptions {
1616
private String dryRun;
1717
private String fieldManager;
1818

19+
public CreateOptions dryRun(String dryRun) {
20+
this.dryRun = dryRun;
21+
return this;
22+
}
23+
1924
public String getDryRun() {
2025
return dryRun;
2126
}
@@ -24,6 +29,11 @@ public void setDryRun(String dryRun) {
2429
this.dryRun = dryRun;
2530
}
2631

32+
public CreateOptions fieldManager(String fieldManager) {
33+
this.fieldManager = fieldManager;
34+
return this;
35+
}
36+
2737
public String getFieldManager() {
2838
return fieldManager;
2939
}

util/src/main/java/io/kubernetes/client/util/generic/options/ListOptions.java

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,11 @@ public class ListOptions {
3333
@SerializedName("continue")
3434
private String _continue;
3535

36+
public ListOptions fieldSelector(String fieldSelector) {
37+
this.fieldSelector = fieldSelector;
38+
return this;
39+
}
40+
3641
public String getFieldSelector() {
3742
return fieldSelector;
3843
}
@@ -41,6 +46,11 @@ public void setFieldSelector(String fieldSelector) {
4146
this.fieldSelector = fieldSelector;
4247
}
4348

49+
public ListOptions labelSelector(String labelSelector) {
50+
this.labelSelector = labelSelector;
51+
return this;
52+
}
53+
4454
public String getLabelSelector() {
4555
return labelSelector;
4656
}
@@ -49,6 +59,11 @@ public void setLabelSelector(String labelSelector) {
4959
this.labelSelector = labelSelector;
5060
}
5161

62+
public ListOptions resourceVersion(String resourceVersion) {
63+
this.resourceVersion = resourceVersion;
64+
return this;
65+
}
66+
5267
public String getResourceVersion() {
5368
return resourceVersion;
5469
}
@@ -57,6 +72,11 @@ public void setResourceVersion(String resourceVersion) {
5772
this.resourceVersion = resourceVersion;
5873
}
5974

75+
public ListOptions limit(Integer limit) {
76+
this.limit = limit;
77+
return this;
78+
}
79+
6080
public Integer getLimit() {
6181
return limit;
6282
}
@@ -65,6 +85,11 @@ public void setLimit(Integer limit) {
6585
this.limit = limit;
6686
}
6787

88+
public ListOptions _continue(String _continue) {
89+
this._continue = _continue;
90+
return this;
91+
}
92+
6893
public String getContinue() {
6994
return _continue;
7095
}
@@ -73,6 +98,11 @@ public void setContinue(String _continue) {
7398
this._continue = _continue;
7499
}
75100

101+
public ListOptions timeoutSeconds(Integer timeoutSeconds) {
102+
this.timeoutSeconds = timeoutSeconds;
103+
return this;
104+
}
105+
76106
public Integer getTimeoutSeconds() {
77107
return timeoutSeconds;
78108
}

util/src/main/java/io/kubernetes/client/util/generic/options/PatchOptions.java

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,11 @@ public class PatchOptions {
1717
private String fieldManager;
1818
private Boolean force;
1919

20+
public PatchOptions dryRun(String dryRun) {
21+
this.dryRun = dryRun;
22+
return this;
23+
}
24+
2025
public String getDryRun() {
2126
return dryRun;
2227
}
@@ -25,6 +30,11 @@ public void setDryRun(String dryRun) {
2530
this.dryRun = dryRun;
2631
}
2732

33+
public PatchOptions force(Boolean force) {
34+
this.force = force;
35+
return this;
36+
}
37+
2838
public Boolean getForce() {
2939
return force;
3040
}
@@ -33,6 +43,11 @@ public void setForce(Boolean force) {
3343
this.force = force;
3444
}
3545

46+
public PatchOptions fieldManager(String fieldManager) {
47+
this.fieldManager = fieldManager;
48+
return this;
49+
}
50+
3651
public String getFieldManager() {
3752
return fieldManager;
3853
}

util/src/main/java/io/kubernetes/client/util/generic/options/UpdateOptions.java

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,11 @@ public class UpdateOptions {
1616
private String dryRun;
1717
private String fieldManager;
1818

19+
public UpdateOptions dryRun(String dryRun) {
20+
this.dryRun = dryRun;
21+
return this;
22+
}
23+
1924
public String getDryRun() {
2025
return dryRun;
2126
}
@@ -24,6 +29,11 @@ public void setDryRun(String dryRun) {
2429
this.dryRun = dryRun;
2530
}
2631

32+
public UpdateOptions fieldManager(String fieldManager) {
33+
this.fieldManager = fieldManager;
34+
return this;
35+
}
36+
2737
public String getFieldManager() {
2838
return fieldManager;
2939
}

0 commit comments

Comments
 (0)