Class V1NetworkPolicyPort
java.lang.Object
io.kubernetes.client.openapi.models.V1NetworkPolicyPort
@Generated(value="org.openapitools.codegen.languages.JavaClientCodegen",
date="2024-10-04T19:37:38.574271Z[Etc/UTC]",
comments="Generator version: 7.6.0")
public class V1NetworkPolicyPort
extends Object
NetworkPolicyPort describes a port to allow traffic on
-
Nested Class Summary
Nested Classes -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionboolean
static V1NetworkPolicyPort
Create an instance of V1NetworkPolicyPort given an JSON stringendPort indicates that the range of ports from port to endPort if set, inclusive, should be allowed by the policy.getPort()
IntOrString is a type that can hold an int32 or a string.protocol represents the protocol (TCP, UDP, or SCTP) which traffic must match.int
hashCode()
port
(IntOrString port) void
setEndPort
(Integer endPort) void
setPort
(IntOrString port) void
setProtocol
(String protocol) toJson()
Convert an instance of V1NetworkPolicyPort to an JSON stringtoString()
static void
validateJsonElement
(com.google.gson.JsonElement jsonElement) Validates the JSON Element and throws an exception if issues found
-
Field Details
-
SERIALIZED_NAME_END_PORT
- See Also:
-
SERIALIZED_NAME_PORT
- See Also:
-
SERIALIZED_NAME_PROTOCOL
- See Also:
-
openapiFields
-
openapiRequiredFields
-
-
Constructor Details
-
V1NetworkPolicyPort
public V1NetworkPolicyPort()
-
-
Method Details
-
endPort
-
getEndPort
endPort indicates that the range of ports from port to endPort if set, inclusive, should be allowed by the policy. This field cannot be defined if the port field is not defined or if the port field is defined as a named (string) port. The endPort must be equal or greater than port.- Returns:
- endPort
-
setEndPort
-
port
-
getPort
IntOrString is a type that can hold an int32 or a string. When used in JSON or YAML marshalling and unmarshalling, it produces or consumes the inner type. This allows you to have, for example, a JSON field that can accept a name or number.- Returns:
- port
-
setPort
-
protocol
-
getProtocol
protocol represents the protocol (TCP, UDP, or SCTP) which traffic must match. If not specified, this field defaults to TCP.- Returns:
- protocol
-
setProtocol
-
equals
-
hashCode
public int hashCode() -
toString
-
validateJsonElement
Validates the JSON Element and throws an exception if issues found- Parameters:
jsonElement
- JSON Element- Throws:
IOException
- if the JSON Element is invalid with respect to V1NetworkPolicyPort
-
fromJson
Create an instance of V1NetworkPolicyPort given an JSON string- Parameters:
jsonString
- JSON string- Returns:
- An instance of V1NetworkPolicyPort
- Throws:
IOException
- if the JSON string is invalid with respect to V1NetworkPolicyPort
-
toJson
Convert an instance of V1NetworkPolicyPort to an JSON string- Returns:
- JSON string
-