Class V1Networking.NetworkPolicyIngressRule.Builder

java.lang.Object
com.google.protobuf.AbstractMessageLite.Builder
com.google.protobuf.AbstractMessage.Builder<BuilderType>
com.google.protobuf.GeneratedMessageV3.Builder<V1Networking.NetworkPolicyIngressRule.Builder>
io.kubernetes.client.proto.V1Networking.NetworkPolicyIngressRule.Builder
All Implemented Interfaces:
com.google.protobuf.Message.Builder, com.google.protobuf.MessageLite.Builder, com.google.protobuf.MessageLiteOrBuilder, com.google.protobuf.MessageOrBuilder, V1Networking.NetworkPolicyIngressRuleOrBuilder, Cloneable
Enclosing class:
V1Networking.NetworkPolicyIngressRule

public static final class V1Networking.NetworkPolicyIngressRule.Builder extends com.google.protobuf.GeneratedMessageV3.Builder<V1Networking.NetworkPolicyIngressRule.Builder> implements V1Networking.NetworkPolicyIngressRuleOrBuilder
 NetworkPolicyIngressRule describes a particular set of traffic that is allowed to the pods
 matched by a NetworkPolicySpec's podSelector. The traffic must match both ports and from.
 
Protobuf type k8s.io.api.networking.v1.NetworkPolicyIngressRule
  • Method Details

    • getDescriptor

      public static final com.google.protobuf.Descriptors.Descriptor getDescriptor()
    • internalGetFieldAccessorTable

      protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
      Specified by:
      internalGetFieldAccessorTable in class com.google.protobuf.GeneratedMessageV3.Builder<V1Networking.NetworkPolicyIngressRule.Builder>
    • clear

      Specified by:
      clear in interface com.google.protobuf.Message.Builder
      Specified by:
      clear in interface com.google.protobuf.MessageLite.Builder
      Overrides:
      clear in class com.google.protobuf.GeneratedMessageV3.Builder<V1Networking.NetworkPolicyIngressRule.Builder>
    • getDescriptorForType

      public com.google.protobuf.Descriptors.Descriptor getDescriptorForType()
      Specified by:
      getDescriptorForType in interface com.google.protobuf.Message.Builder
      Specified by:
      getDescriptorForType in interface com.google.protobuf.MessageOrBuilder
      Overrides:
      getDescriptorForType in class com.google.protobuf.GeneratedMessageV3.Builder<V1Networking.NetworkPolicyIngressRule.Builder>
    • getDefaultInstanceForType

      public V1Networking.NetworkPolicyIngressRule getDefaultInstanceForType()
      Specified by:
      getDefaultInstanceForType in interface com.google.protobuf.MessageLiteOrBuilder
      Specified by:
      getDefaultInstanceForType in interface com.google.protobuf.MessageOrBuilder
    • build

      Specified by:
      build in interface com.google.protobuf.Message.Builder
      Specified by:
      build in interface com.google.protobuf.MessageLite.Builder
    • buildPartial

      Specified by:
      buildPartial in interface com.google.protobuf.Message.Builder
      Specified by:
      buildPartial in interface com.google.protobuf.MessageLite.Builder
    • clone

      Specified by:
      clone in interface com.google.protobuf.Message.Builder
      Specified by:
      clone in interface com.google.protobuf.MessageLite.Builder
      Overrides:
      clone in class com.google.protobuf.GeneratedMessageV3.Builder<V1Networking.NetworkPolicyIngressRule.Builder>
    • setField

      public V1Networking.NetworkPolicyIngressRule.Builder setField(com.google.protobuf.Descriptors.FieldDescriptor field, Object value)
      Specified by:
      setField in interface com.google.protobuf.Message.Builder
      Overrides:
      setField in class com.google.protobuf.GeneratedMessageV3.Builder<V1Networking.NetworkPolicyIngressRule.Builder>
    • clearField

      public V1Networking.NetworkPolicyIngressRule.Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field)
      Specified by:
      clearField in interface com.google.protobuf.Message.Builder
      Overrides:
      clearField in class com.google.protobuf.GeneratedMessageV3.Builder<V1Networking.NetworkPolicyIngressRule.Builder>
    • clearOneof

      public V1Networking.NetworkPolicyIngressRule.Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof)
      Specified by:
      clearOneof in interface com.google.protobuf.Message.Builder
      Overrides:
      clearOneof in class com.google.protobuf.GeneratedMessageV3.Builder<V1Networking.NetworkPolicyIngressRule.Builder>
    • setRepeatedField

      public V1Networking.NetworkPolicyIngressRule.Builder setRepeatedField(com.google.protobuf.Descriptors.FieldDescriptor field, int index, Object value)
      Specified by:
      setRepeatedField in interface com.google.protobuf.Message.Builder
      Overrides:
      setRepeatedField in class com.google.protobuf.GeneratedMessageV3.Builder<V1Networking.NetworkPolicyIngressRule.Builder>
    • addRepeatedField

      public V1Networking.NetworkPolicyIngressRule.Builder addRepeatedField(com.google.protobuf.Descriptors.FieldDescriptor field, Object value)
      Specified by:
      addRepeatedField in interface com.google.protobuf.Message.Builder
      Overrides:
      addRepeatedField in class com.google.protobuf.GeneratedMessageV3.Builder<V1Networking.NetworkPolicyIngressRule.Builder>
    • mergeFrom

      public V1Networking.NetworkPolicyIngressRule.Builder mergeFrom(com.google.protobuf.Message other)
      Specified by:
      mergeFrom in interface com.google.protobuf.Message.Builder
      Overrides:
      mergeFrom in class com.google.protobuf.AbstractMessage.Builder<V1Networking.NetworkPolicyIngressRule.Builder>
    • mergeFrom

    • isInitialized

      public final boolean isInitialized()
      Specified by:
      isInitialized in interface com.google.protobuf.MessageLiteOrBuilder
      Overrides:
      isInitialized in class com.google.protobuf.GeneratedMessageV3.Builder<V1Networking.NetworkPolicyIngressRule.Builder>
    • mergeFrom

      public V1Networking.NetworkPolicyIngressRule.Builder mergeFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws IOException
      Specified by:
      mergeFrom in interface com.google.protobuf.Message.Builder
      Specified by:
      mergeFrom in interface com.google.protobuf.MessageLite.Builder
      Overrides:
      mergeFrom in class com.google.protobuf.AbstractMessage.Builder<V1Networking.NetworkPolicyIngressRule.Builder>
      Throws:
      IOException
    • getPortsList

      public List<V1Networking.NetworkPolicyPort> getPortsList()
       List of ports which should be made accessible on the pods selected for this
       rule. Each item in this list is combined using a logical OR. If this field is
       empty or missing, this rule matches all ports (traffic not restricted by port).
       If this field is present and contains at least one item, then this rule allows
       traffic only if the traffic matches at least one port in the list.
       +optional
       
      repeated .k8s.io.api.networking.v1.NetworkPolicyPort ports = 1;
      Specified by:
      getPortsList in interface V1Networking.NetworkPolicyIngressRuleOrBuilder
    • getPortsCount

      public int getPortsCount()
       List of ports which should be made accessible on the pods selected for this
       rule. Each item in this list is combined using a logical OR. If this field is
       empty or missing, this rule matches all ports (traffic not restricted by port).
       If this field is present and contains at least one item, then this rule allows
       traffic only if the traffic matches at least one port in the list.
       +optional
       
      repeated .k8s.io.api.networking.v1.NetworkPolicyPort ports = 1;
      Specified by:
      getPortsCount in interface V1Networking.NetworkPolicyIngressRuleOrBuilder
    • getPorts

      public V1Networking.NetworkPolicyPort getPorts(int index)
       List of ports which should be made accessible on the pods selected for this
       rule. Each item in this list is combined using a logical OR. If this field is
       empty or missing, this rule matches all ports (traffic not restricted by port).
       If this field is present and contains at least one item, then this rule allows
       traffic only if the traffic matches at least one port in the list.
       +optional
       
      repeated .k8s.io.api.networking.v1.NetworkPolicyPort ports = 1;
      Specified by:
      getPorts in interface V1Networking.NetworkPolicyIngressRuleOrBuilder
    • setPorts

       List of ports which should be made accessible on the pods selected for this
       rule. Each item in this list is combined using a logical OR. If this field is
       empty or missing, this rule matches all ports (traffic not restricted by port).
       If this field is present and contains at least one item, then this rule allows
       traffic only if the traffic matches at least one port in the list.
       +optional
       
      repeated .k8s.io.api.networking.v1.NetworkPolicyPort ports = 1;
    • setPorts

       List of ports which should be made accessible on the pods selected for this
       rule. Each item in this list is combined using a logical OR. If this field is
       empty or missing, this rule matches all ports (traffic not restricted by port).
       If this field is present and contains at least one item, then this rule allows
       traffic only if the traffic matches at least one port in the list.
       +optional
       
      repeated .k8s.io.api.networking.v1.NetworkPolicyPort ports = 1;
    • addPorts

       List of ports which should be made accessible on the pods selected for this
       rule. Each item in this list is combined using a logical OR. If this field is
       empty or missing, this rule matches all ports (traffic not restricted by port).
       If this field is present and contains at least one item, then this rule allows
       traffic only if the traffic matches at least one port in the list.
       +optional
       
      repeated .k8s.io.api.networking.v1.NetworkPolicyPort ports = 1;
    • addPorts

       List of ports which should be made accessible on the pods selected for this
       rule. Each item in this list is combined using a logical OR. If this field is
       empty or missing, this rule matches all ports (traffic not restricted by port).
       If this field is present and contains at least one item, then this rule allows
       traffic only if the traffic matches at least one port in the list.
       +optional
       
      repeated .k8s.io.api.networking.v1.NetworkPolicyPort ports = 1;
    • addPorts

       List of ports which should be made accessible on the pods selected for this
       rule. Each item in this list is combined using a logical OR. If this field is
       empty or missing, this rule matches all ports (traffic not restricted by port).
       If this field is present and contains at least one item, then this rule allows
       traffic only if the traffic matches at least one port in the list.
       +optional
       
      repeated .k8s.io.api.networking.v1.NetworkPolicyPort ports = 1;
    • addPorts

       List of ports which should be made accessible on the pods selected for this
       rule. Each item in this list is combined using a logical OR. If this field is
       empty or missing, this rule matches all ports (traffic not restricted by port).
       If this field is present and contains at least one item, then this rule allows
       traffic only if the traffic matches at least one port in the list.
       +optional
       
      repeated .k8s.io.api.networking.v1.NetworkPolicyPort ports = 1;
    • addAllPorts

       List of ports which should be made accessible on the pods selected for this
       rule. Each item in this list is combined using a logical OR. If this field is
       empty or missing, this rule matches all ports (traffic not restricted by port).
       If this field is present and contains at least one item, then this rule allows
       traffic only if the traffic matches at least one port in the list.
       +optional
       
      repeated .k8s.io.api.networking.v1.NetworkPolicyPort ports = 1;
    • clearPorts

       List of ports which should be made accessible on the pods selected for this
       rule. Each item in this list is combined using a logical OR. If this field is
       empty or missing, this rule matches all ports (traffic not restricted by port).
       If this field is present and contains at least one item, then this rule allows
       traffic only if the traffic matches at least one port in the list.
       +optional
       
      repeated .k8s.io.api.networking.v1.NetworkPolicyPort ports = 1;
    • removePorts

      public V1Networking.NetworkPolicyIngressRule.Builder removePorts(int index)
       List of ports which should be made accessible on the pods selected for this
       rule. Each item in this list is combined using a logical OR. If this field is
       empty or missing, this rule matches all ports (traffic not restricted by port).
       If this field is present and contains at least one item, then this rule allows
       traffic only if the traffic matches at least one port in the list.
       +optional
       
      repeated .k8s.io.api.networking.v1.NetworkPolicyPort ports = 1;
    • getPortsBuilder

      public V1Networking.NetworkPolicyPort.Builder getPortsBuilder(int index)
       List of ports which should be made accessible on the pods selected for this
       rule. Each item in this list is combined using a logical OR. If this field is
       empty or missing, this rule matches all ports (traffic not restricted by port).
       If this field is present and contains at least one item, then this rule allows
       traffic only if the traffic matches at least one port in the list.
       +optional
       
      repeated .k8s.io.api.networking.v1.NetworkPolicyPort ports = 1;
    • getPortsOrBuilder

      public V1Networking.NetworkPolicyPortOrBuilder getPortsOrBuilder(int index)
       List of ports which should be made accessible on the pods selected for this
       rule. Each item in this list is combined using a logical OR. If this field is
       empty or missing, this rule matches all ports (traffic not restricted by port).
       If this field is present and contains at least one item, then this rule allows
       traffic only if the traffic matches at least one port in the list.
       +optional
       
      repeated .k8s.io.api.networking.v1.NetworkPolicyPort ports = 1;
      Specified by:
      getPortsOrBuilder in interface V1Networking.NetworkPolicyIngressRuleOrBuilder
    • getPortsOrBuilderList

      public List<? extends V1Networking.NetworkPolicyPortOrBuilder> getPortsOrBuilderList()
       List of ports which should be made accessible on the pods selected for this
       rule. Each item in this list is combined using a logical OR. If this field is
       empty or missing, this rule matches all ports (traffic not restricted by port).
       If this field is present and contains at least one item, then this rule allows
       traffic only if the traffic matches at least one port in the list.
       +optional
       
      repeated .k8s.io.api.networking.v1.NetworkPolicyPort ports = 1;
      Specified by:
      getPortsOrBuilderList in interface V1Networking.NetworkPolicyIngressRuleOrBuilder
    • addPortsBuilder

      public V1Networking.NetworkPolicyPort.Builder addPortsBuilder()
       List of ports which should be made accessible on the pods selected for this
       rule. Each item in this list is combined using a logical OR. If this field is
       empty or missing, this rule matches all ports (traffic not restricted by port).
       If this field is present and contains at least one item, then this rule allows
       traffic only if the traffic matches at least one port in the list.
       +optional
       
      repeated .k8s.io.api.networking.v1.NetworkPolicyPort ports = 1;
    • addPortsBuilder

      public V1Networking.NetworkPolicyPort.Builder addPortsBuilder(int index)
       List of ports which should be made accessible on the pods selected for this
       rule. Each item in this list is combined using a logical OR. If this field is
       empty or missing, this rule matches all ports (traffic not restricted by port).
       If this field is present and contains at least one item, then this rule allows
       traffic only if the traffic matches at least one port in the list.
       +optional
       
      repeated .k8s.io.api.networking.v1.NetworkPolicyPort ports = 1;
    • getPortsBuilderList

      public List<V1Networking.NetworkPolicyPort.Builder> getPortsBuilderList()
       List of ports which should be made accessible on the pods selected for this
       rule. Each item in this list is combined using a logical OR. If this field is
       empty or missing, this rule matches all ports (traffic not restricted by port).
       If this field is present and contains at least one item, then this rule allows
       traffic only if the traffic matches at least one port in the list.
       +optional
       
      repeated .k8s.io.api.networking.v1.NetworkPolicyPort ports = 1;
    • getFromList

      public List<V1Networking.NetworkPolicyPeer> getFromList()
       List of sources which should be able to access the pods selected for this rule.
       Items in this list are combined using a logical OR operation. If this field is
       empty or missing, this rule matches all sources (traffic not restricted by
       source). If this field is present and contains at least one item, this rule
       allows traffic only if the traffic matches at least one item in the from list.
       +optional
       
      repeated .k8s.io.api.networking.v1.NetworkPolicyPeer from = 2;
      Specified by:
      getFromList in interface V1Networking.NetworkPolicyIngressRuleOrBuilder
    • getFromCount

      public int getFromCount()
       List of sources which should be able to access the pods selected for this rule.
       Items in this list are combined using a logical OR operation. If this field is
       empty or missing, this rule matches all sources (traffic not restricted by
       source). If this field is present and contains at least one item, this rule
       allows traffic only if the traffic matches at least one item in the from list.
       +optional
       
      repeated .k8s.io.api.networking.v1.NetworkPolicyPeer from = 2;
      Specified by:
      getFromCount in interface V1Networking.NetworkPolicyIngressRuleOrBuilder
    • getFrom

      public V1Networking.NetworkPolicyPeer getFrom(int index)
       List of sources which should be able to access the pods selected for this rule.
       Items in this list are combined using a logical OR operation. If this field is
       empty or missing, this rule matches all sources (traffic not restricted by
       source). If this field is present and contains at least one item, this rule
       allows traffic only if the traffic matches at least one item in the from list.
       +optional
       
      repeated .k8s.io.api.networking.v1.NetworkPolicyPeer from = 2;
      Specified by:
      getFrom in interface V1Networking.NetworkPolicyIngressRuleOrBuilder
    • setFrom

       List of sources which should be able to access the pods selected for this rule.
       Items in this list are combined using a logical OR operation. If this field is
       empty or missing, this rule matches all sources (traffic not restricted by
       source). If this field is present and contains at least one item, this rule
       allows traffic only if the traffic matches at least one item in the from list.
       +optional
       
      repeated .k8s.io.api.networking.v1.NetworkPolicyPeer from = 2;
    • setFrom

       List of sources which should be able to access the pods selected for this rule.
       Items in this list are combined using a logical OR operation. If this field is
       empty or missing, this rule matches all sources (traffic not restricted by
       source). If this field is present and contains at least one item, this rule
       allows traffic only if the traffic matches at least one item in the from list.
       +optional
       
      repeated .k8s.io.api.networking.v1.NetworkPolicyPeer from = 2;
    • addFrom

       List of sources which should be able to access the pods selected for this rule.
       Items in this list are combined using a logical OR operation. If this field is
       empty or missing, this rule matches all sources (traffic not restricted by
       source). If this field is present and contains at least one item, this rule
       allows traffic only if the traffic matches at least one item in the from list.
       +optional
       
      repeated .k8s.io.api.networking.v1.NetworkPolicyPeer from = 2;
    • addFrom

       List of sources which should be able to access the pods selected for this rule.
       Items in this list are combined using a logical OR operation. If this field is
       empty or missing, this rule matches all sources (traffic not restricted by
       source). If this field is present and contains at least one item, this rule
       allows traffic only if the traffic matches at least one item in the from list.
       +optional
       
      repeated .k8s.io.api.networking.v1.NetworkPolicyPeer from = 2;
    • addFrom

       List of sources which should be able to access the pods selected for this rule.
       Items in this list are combined using a logical OR operation. If this field is
       empty or missing, this rule matches all sources (traffic not restricted by
       source). If this field is present and contains at least one item, this rule
       allows traffic only if the traffic matches at least one item in the from list.
       +optional
       
      repeated .k8s.io.api.networking.v1.NetworkPolicyPeer from = 2;
    • addFrom

       List of sources which should be able to access the pods selected for this rule.
       Items in this list are combined using a logical OR operation. If this field is
       empty or missing, this rule matches all sources (traffic not restricted by
       source). If this field is present and contains at least one item, this rule
       allows traffic only if the traffic matches at least one item in the from list.
       +optional
       
      repeated .k8s.io.api.networking.v1.NetworkPolicyPeer from = 2;
    • addAllFrom

       List of sources which should be able to access the pods selected for this rule.
       Items in this list are combined using a logical OR operation. If this field is
       empty or missing, this rule matches all sources (traffic not restricted by
       source). If this field is present and contains at least one item, this rule
       allows traffic only if the traffic matches at least one item in the from list.
       +optional
       
      repeated .k8s.io.api.networking.v1.NetworkPolicyPeer from = 2;
    • clearFrom

       List of sources which should be able to access the pods selected for this rule.
       Items in this list are combined using a logical OR operation. If this field is
       empty or missing, this rule matches all sources (traffic not restricted by
       source). If this field is present and contains at least one item, this rule
       allows traffic only if the traffic matches at least one item in the from list.
       +optional
       
      repeated .k8s.io.api.networking.v1.NetworkPolicyPeer from = 2;
    • removeFrom

      public V1Networking.NetworkPolicyIngressRule.Builder removeFrom(int index)
       List of sources which should be able to access the pods selected for this rule.
       Items in this list are combined using a logical OR operation. If this field is
       empty or missing, this rule matches all sources (traffic not restricted by
       source). If this field is present and contains at least one item, this rule
       allows traffic only if the traffic matches at least one item in the from list.
       +optional
       
      repeated .k8s.io.api.networking.v1.NetworkPolicyPeer from = 2;
    • getFromBuilder

      public V1Networking.NetworkPolicyPeer.Builder getFromBuilder(int index)
       List of sources which should be able to access the pods selected for this rule.
       Items in this list are combined using a logical OR operation. If this field is
       empty or missing, this rule matches all sources (traffic not restricted by
       source). If this field is present and contains at least one item, this rule
       allows traffic only if the traffic matches at least one item in the from list.
       +optional
       
      repeated .k8s.io.api.networking.v1.NetworkPolicyPeer from = 2;
    • getFromOrBuilder

      public V1Networking.NetworkPolicyPeerOrBuilder getFromOrBuilder(int index)
       List of sources which should be able to access the pods selected for this rule.
       Items in this list are combined using a logical OR operation. If this field is
       empty or missing, this rule matches all sources (traffic not restricted by
       source). If this field is present and contains at least one item, this rule
       allows traffic only if the traffic matches at least one item in the from list.
       +optional
       
      repeated .k8s.io.api.networking.v1.NetworkPolicyPeer from = 2;
      Specified by:
      getFromOrBuilder in interface V1Networking.NetworkPolicyIngressRuleOrBuilder
    • getFromOrBuilderList

      public List<? extends V1Networking.NetworkPolicyPeerOrBuilder> getFromOrBuilderList()
       List of sources which should be able to access the pods selected for this rule.
       Items in this list are combined using a logical OR operation. If this field is
       empty or missing, this rule matches all sources (traffic not restricted by
       source). If this field is present and contains at least one item, this rule
       allows traffic only if the traffic matches at least one item in the from list.
       +optional
       
      repeated .k8s.io.api.networking.v1.NetworkPolicyPeer from = 2;
      Specified by:
      getFromOrBuilderList in interface V1Networking.NetworkPolicyIngressRuleOrBuilder
    • addFromBuilder

      public V1Networking.NetworkPolicyPeer.Builder addFromBuilder()
       List of sources which should be able to access the pods selected for this rule.
       Items in this list are combined using a logical OR operation. If this field is
       empty or missing, this rule matches all sources (traffic not restricted by
       source). If this field is present and contains at least one item, this rule
       allows traffic only if the traffic matches at least one item in the from list.
       +optional
       
      repeated .k8s.io.api.networking.v1.NetworkPolicyPeer from = 2;
    • addFromBuilder

      public V1Networking.NetworkPolicyPeer.Builder addFromBuilder(int index)
       List of sources which should be able to access the pods selected for this rule.
       Items in this list are combined using a logical OR operation. If this field is
       empty or missing, this rule matches all sources (traffic not restricted by
       source). If this field is present and contains at least one item, this rule
       allows traffic only if the traffic matches at least one item in the from list.
       +optional
       
      repeated .k8s.io.api.networking.v1.NetworkPolicyPeer from = 2;
    • getFromBuilderList

      public List<V1Networking.NetworkPolicyPeer.Builder> getFromBuilderList()
       List of sources which should be able to access the pods selected for this rule.
       Items in this list are combined using a logical OR operation. If this field is
       empty or missing, this rule matches all sources (traffic not restricted by
       source). If this field is present and contains at least one item, this rule
       allows traffic only if the traffic matches at least one item in the from list.
       +optional
       
      repeated .k8s.io.api.networking.v1.NetworkPolicyPeer from = 2;
    • setUnknownFields

      public final V1Networking.NetworkPolicyIngressRule.Builder setUnknownFields(com.google.protobuf.UnknownFieldSet unknownFields)
      Specified by:
      setUnknownFields in interface com.google.protobuf.Message.Builder
      Overrides:
      setUnknownFields in class com.google.protobuf.GeneratedMessageV3.Builder<V1Networking.NetworkPolicyIngressRule.Builder>
    • mergeUnknownFields

      public final V1Networking.NetworkPolicyIngressRule.Builder mergeUnknownFields(com.google.protobuf.UnknownFieldSet unknownFields)
      Specified by:
      mergeUnknownFields in interface com.google.protobuf.Message.Builder
      Overrides:
      mergeUnknownFields in class com.google.protobuf.GeneratedMessageV3.Builder<V1Networking.NetworkPolicyIngressRule.Builder>