Partager via


PortRange Class

  • java.lang.Object
    • com.azure.resourcemanager.containerservice.models.PortRange

Implements

public final class PortRange
implements JsonSerializable<PortRange>

The port range.

Constructor Summary

Constructor Description
PortRange()

Creates an instance of PortRange class.

Method Summary

Modifier and Type Method and Description
static PortRange fromJson(JsonReader jsonReader)

Reads an instance of PortRange from the JsonReader.

Integer portEnd()

Get the portEnd property: The maximum port that is included in the range.

Integer portStart()

Get the portStart property: The minimum port that is included in the range.

Protocol protocol()

Get the protocol property: The network protocol of the port.

JsonWriter toJson(JsonWriter jsonWriter)
void validate()

Validates the instance.

PortRange withPortEnd(Integer portEnd)

Set the portEnd property: The maximum port that is included in the range.

PortRange withPortStart(Integer portStart)

Set the portStart property: The minimum port that is included in the range.

PortRange withProtocol(Protocol protocol)

Set the protocol property: The network protocol of the port.

Methods inherited from java.lang.Object

Constructor Details

PortRange

public PortRange()

Creates an instance of PortRange class.

Method Details

fromJson

public static PortRange fromJson(JsonReader jsonReader)

Reads an instance of PortRange from the JsonReader.

Parameters:

jsonReader - The JsonReader being read.

Returns:

An instance of PortRange if the JsonReader was pointing to an instance of it, or null if it was pointing to JSON null.

Throws:

IOException

- If an error occurs while reading the PortRange.

portEnd

public Integer portEnd()

Get the portEnd property: The maximum port that is included in the range. It should be ranged from 1 to 65535, and be greater than or equal to portStart.

Returns:

the portEnd value.

portStart

public Integer portStart()

Get the portStart property: The minimum port that is included in the range. It should be ranged from 1 to 65535, and be less than or equal to portEnd.

Returns:

the portStart value.

protocol

public Protocol protocol()

Get the protocol property: The network protocol of the port.

Returns:

the protocol value.

toJson

public JsonWriter toJson(JsonWriter jsonWriter)

Parameters:

jsonWriter

Throws:

validate

public void validate()

Validates the instance.

withPortEnd

public PortRange withPortEnd(Integer portEnd)

Set the portEnd property: The maximum port that is included in the range. It should be ranged from 1 to 65535, and be greater than or equal to portStart.

Parameters:

portEnd - the portEnd value to set.

Returns:

the PortRange object itself.

withPortStart

public PortRange withPortStart(Integer portStart)

Set the portStart property: The minimum port that is included in the range. It should be ranged from 1 to 65535, and be less than or equal to portEnd.

Parameters:

portStart - the portStart value to set.

Returns:

the PortRange object itself.

withProtocol

public PortRange withProtocol(Protocol protocol)

Set the protocol property: The network protocol of the port.

Parameters:

protocol - the protocol value to set.

Returns:

the PortRange object itself.

Applies to