Class NetworkPolicy.Builder (2.49.0)

public static final class NetworkPolicy.Builder extends GeneratedMessageV3.Builder<NetworkPolicy.Builder> implements NetworkPolicyOrBuilder

Configuration options for the NetworkPolicy feature. https://kubernetes.io/docs/concepts/services-networking/networkpolicies/

Protobuf type google.container.v1.NetworkPolicy

Static Methods

getDescriptor()

public static final Descriptors.Descriptor getDescriptor()
Returns
Type Description
Descriptor

Methods

addRepeatedField(Descriptors.FieldDescriptor field, Object value)

public NetworkPolicy.Builder addRepeatedField(Descriptors.FieldDescriptor field, Object value)
Parameters
Name Description
field FieldDescriptor
value Object
Returns
Type Description
NetworkPolicy.Builder
Overrides

build()

public NetworkPolicy build()
Returns
Type Description
NetworkPolicy

buildPartial()

public NetworkPolicy buildPartial()
Returns
Type Description
NetworkPolicy

clear()

public NetworkPolicy.Builder clear()
Returns
Type Description
NetworkPolicy.Builder
Overrides

clearEnabled()

public NetworkPolicy.Builder clearEnabled()

Whether network policy is enabled on the cluster.

bool enabled = 2;

Returns
Type Description
NetworkPolicy.Builder

This builder for chaining.

clearField(Descriptors.FieldDescriptor field)

public NetworkPolicy.Builder clearField(Descriptors.FieldDescriptor field)
Parameter
Name Description
field FieldDescriptor
Returns
Type Description
NetworkPolicy.Builder
Overrides

clearOneof(Descriptors.OneofDescriptor oneof)

public NetworkPolicy.Builder clearOneof(Descriptors.OneofDescriptor oneof)
Parameter
Name Description
oneof OneofDescriptor
Returns
Type Description
NetworkPolicy.Builder
Overrides

clearProvider()

public NetworkPolicy.Builder clearProvider()

The selected network policy provider.

.google.container.v1.NetworkPolicy.Provider provider = 1;

Returns
Type Description
NetworkPolicy.Builder

This builder for chaining.

clone()

public NetworkPolicy.Builder clone()
Returns
Type Description
NetworkPolicy.Builder
Overrides

getDefaultInstanceForType()

public NetworkPolicy getDefaultInstanceForType()
Returns
Type Description
NetworkPolicy

getDescriptorForType()

public Descriptors.Descriptor getDescriptorForType()
Returns
Type Description
Descriptor
Overrides

getEnabled()

public boolean getEnabled()

Whether network policy is enabled on the cluster.

bool enabled = 2;

Returns
Type Description
boolean

The enabled.

getProvider()

public NetworkPolicy.Provider getProvider()

The selected network policy provider.

.google.container.v1.NetworkPolicy.Provider provider = 1;

Returns
Type Description
NetworkPolicy.Provider

The provider.

getProviderValue()

public int getProviderValue()

The selected network policy provider.

.google.container.v1.NetworkPolicy.Provider provider = 1;

Returns
Type Description
int

The enum numeric value on the wire for provider.

internalGetFieldAccessorTable()

protected GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
Returns
Type Description
FieldAccessorTable
Overrides

isInitialized()

public final boolean isInitialized()
Returns
Type Description
boolean
Overrides

mergeFrom(NetworkPolicy other)

public NetworkPolicy.Builder mergeFrom(NetworkPolicy other)
Parameter
Name Description
other NetworkPolicy
Returns
Type Description
NetworkPolicy.Builder

mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

public NetworkPolicy.Builder mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
input CodedInputStream
extensionRegistry ExtensionRegistryLite
Returns
Type Description
NetworkPolicy.Builder
Overrides
Exceptions
Type Description
IOException

mergeFrom(Message other)

public NetworkPolicy.Builder mergeFrom(Message other)
Parameter
Name Description
other Message
Returns
Type Description
NetworkPolicy.Builder
Overrides

mergeUnknownFields(UnknownFieldSet unknownFields)

public final NetworkPolicy.Builder mergeUnknownFields(UnknownFieldSet unknownFields)
Parameter
Name Description
unknownFields UnknownFieldSet
Returns
Type Description
NetworkPolicy.Builder
Overrides

setEnabled(boolean value)

public NetworkPolicy.Builder setEnabled(boolean value)

Whether network policy is enabled on the cluster.

bool enabled = 2;

Parameter
Name Description
value boolean

The enabled to set.

Returns
Type Description
NetworkPolicy.Builder

This builder for chaining.

setField(Descriptors.FieldDescriptor field, Object value)

public NetworkPolicy.Builder setField(Descriptors.FieldDescriptor field, Object value)
Parameters
Name Description
field FieldDescriptor
value Object
Returns
Type Description
NetworkPolicy.Builder
Overrides

setProvider(NetworkPolicy.Provider value)

public NetworkPolicy.Builder setProvider(NetworkPolicy.Provider value)

The selected network policy provider.

.google.container.v1.NetworkPolicy.Provider provider = 1;

Parameter
Name Description
value NetworkPolicy.Provider

The provider to set.

Returns
Type Description
NetworkPolicy.Builder

This builder for chaining.

setProviderValue(int value)

public NetworkPolicy.Builder setProviderValue(int value)

The selected network policy provider.

.google.container.v1.NetworkPolicy.Provider provider = 1;

Parameter
Name Description
value int

The enum numeric value on the wire for provider to set.

Returns
Type Description
NetworkPolicy.Builder

This builder for chaining.

setRepeatedField(Descriptors.FieldDescriptor field, int index, Object value)

public NetworkPolicy.Builder setRepeatedField(Descriptors.FieldDescriptor field, int index, Object value)
Parameters
Name Description
field FieldDescriptor
index int
value Object
Returns
Type Description
NetworkPolicy.Builder
Overrides

setUnknownFields(UnknownFieldSet unknownFields)

public final NetworkPolicy.Builder setUnknownFields(UnknownFieldSet unknownFields)
Parameter
Name Description
unknownFields UnknownFieldSet
Returns
Type Description
NetworkPolicy.Builder
Overrides