Skip to content

Commit

Permalink
fixes problem seen in [kubernetes-client#115]
Browse files Browse the repository at this point in the history
This commit is not meant to be merged directly but the required generated result that is needed
  • Loading branch information
kadwanev committed Nov 13, 2017
1 parent 57eb4e0 commit f8c1d89
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,11 @@ public Integer getIntValue() {
return intValue;
}

@Override
public String toString() {
return (isInteger() ? String.valueOf(getIntValue()) : "\"" + getStrValue() + "\"");
}

public static class IntOrStringAdapter extends TypeAdapter<IntOrString> {
@Override
public void write(JsonWriter jsonWriter, IntOrString intOrString) throws IOException {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
import com.google.gson.annotations.SerializedName;
import com.google.gson.stream.JsonReader;
import com.google.gson.stream.JsonWriter;
import io.kubernetes.client.custom.IntOrString;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.io.IOException;
Expand All @@ -30,12 +31,12 @@

public class V1NetworkPolicyPort {
@SerializedName("port")
private String port = null;
private IntOrString port = null;

@SerializedName("protocol")
private String protocol = null;

public V1NetworkPolicyPort port(String port) {
public V1NetworkPolicyPort port(IntOrString port) {
this.port = port;
return this;
}
Expand All @@ -45,11 +46,11 @@ public V1NetworkPolicyPort port(String port) {
* @return port
**/
@ApiModelProperty(value = "The port on the given protocol. This can either be a numerical or named port on a pod. If this field is not provided, this matches all port names and numbers.")
public String getPort() {
public IntOrString getPort() {
return port;
}

public void setPort(String port) {
public void setPort(IntOrString port) {
this.port = port;
}

Expand Down

0 comments on commit f8c1d89

Please sign in to comment.