Class V1NetworkPolicyPeer

java.lang.Object
io.kubernetes.client.openapi.models.V1NetworkPolicyPeer

@Generated(value="org.openapitools.codegen.languages.JavaClientCodegen", date="2025-02-12T21:15:49.397498Z[Etc/UTC]", comments="Generator version: 7.6.0") public class V1NetworkPolicyPeer extends Object
NetworkPolicyPeer describes a peer to allow traffic to/from. Only certain combinations of fields are allowed
  • Field Details

  • Constructor Details

    • V1NetworkPolicyPeer

      public V1NetworkPolicyPeer()
  • Method Details

    • ipBlock

      public V1NetworkPolicyPeer ipBlock(V1IPBlock ipBlock)
    • getIpBlock

      @Nullable public V1IPBlock getIpBlock()
      Get ipBlock
      Returns:
      ipBlock
    • setIpBlock

      public void setIpBlock(V1IPBlock ipBlock)
    • namespaceSelector

      public V1NetworkPolicyPeer namespaceSelector(V1LabelSelector namespaceSelector)
    • getNamespaceSelector

      @Nullable public V1LabelSelector getNamespaceSelector()
      Get namespaceSelector
      Returns:
      namespaceSelector
    • setNamespaceSelector

      public void setNamespaceSelector(V1LabelSelector namespaceSelector)
    • podSelector

      public V1NetworkPolicyPeer podSelector(V1LabelSelector podSelector)
    • getPodSelector

      @Nullable public V1LabelSelector getPodSelector()
      Get podSelector
      Returns:
      podSelector
    • setPodSelector

      public void setPodSelector(V1LabelSelector podSelector)
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • validateJsonElement

      public static void validateJsonElement(com.google.gson.JsonElement jsonElement) throws IOException
      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 V1NetworkPolicyPeer
    • fromJson

      public static V1NetworkPolicyPeer fromJson(String jsonString) throws IOException
      Create an instance of V1NetworkPolicyPeer given an JSON string
      Parameters:
      jsonString - JSON string
      Returns:
      An instance of V1NetworkPolicyPeer
      Throws:
      IOException - if the JSON string is invalid with respect to V1NetworkPolicyPeer
    • toJson

      public String toJson()
      Convert an instance of V1NetworkPolicyPeer to an JSON string
      Returns:
      JSON string