Jagamisviis:


PortRange Class

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

Implements

public final class PortRange
implements JsonSerializable<PortRange>

Port Range to specify particular destination ports for TCP rules.

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.

int max()

Get the max property: The maximum port number, which must not be less than the minimum port number.

int min()

Get the min property: The minimum port number, which must not be greater than the maximum port number.

JsonWriter toJson(JsonWriter jsonWriter)
void validate()

Validates the instance.

PortRange withMax(int max)

Set the max property: The maximum port number, which must not be less than the minimum port number.

PortRange withMin(int min)

Set the min property: The minimum port number, which must not be greater than the maximum port number.

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 the deserialized JSON object was missing any required properties.

max

public int max()

Get the max property: The maximum port number, which must not be less than the minimum port number. To specify a single port number, set both the min and max to the same value.

Returns:

the max value.

min

public int min()

Get the min property: The minimum port number, which must not be greater than the maximum port number.

Returns:

the min value.

toJson

public JsonWriter toJson(JsonWriter jsonWriter)

Parameters:

jsonWriter

Throws:

validate

public void validate()

Validates the instance.

withMax

public PortRange withMax(int max)

Set the max property: The maximum port number, which must not be less than the minimum port number. To specify a single port number, set both the min and max to the same value.

Parameters:

max - the max value to set.

Returns:

the PortRange object itself.

withMin

public PortRange withMin(int min)

Set the min property: The minimum port number, which must not be greater than the maximum port number.

Parameters:

min - the min value to set.

Returns:

the PortRange object itself.

Applies to