Freigeben über


Port Class

  • java.lang.Object
    • com.azure.resourcemanager.containerinstance.models.Port

Implements

public final class Port
implements JsonSerializable<Port>

The port exposed on the container group.

Constructor Summary

Constructor Description
Port()

Creates an instance of Port class.

Method Summary

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

Reads an instance of Port from the JsonReader.

int port()

Get the port property: The port number.

ContainerGroupNetworkProtocol protocol()

Get the protocol property: The protocol associated with the port.

JsonWriter toJson(JsonWriter jsonWriter)
void validate()

Validates the instance.

Port withPort(int port)

Set the port property: The port number.

Port withProtocol(ContainerGroupNetworkProtocol protocol)

Set the protocol property: The protocol associated with the port.

Methods inherited from java.lang.Object

Constructor Details

Port

public Port()

Creates an instance of Port class.

Method Details

fromJson

public static Port fromJson(JsonReader jsonReader)

Reads an instance of Port from the JsonReader.

Parameters:

jsonReader - The JsonReader being read.

Returns:

An instance of Port 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.

port

public int port()

Get the port property: The port number.

Returns:

the port value.

protocol

public ContainerGroupNetworkProtocol protocol()

Get the protocol property: The protocol associated with the port.

Returns:

the protocol value.

toJson

public JsonWriter toJson(JsonWriter jsonWriter)

Parameters:

jsonWriter

Throws:

validate

public void validate()

Validates the instance.

withPort

public Port withPort(int port)

Set the port property: The port number.

Parameters:

port - the port value to set.

Returns:

the Port object itself.

withProtocol

public Port withProtocol(ContainerGroupNetworkProtocol protocol)

Set the protocol property: The protocol associated with the port.

Parameters:

protocol - the protocol value to set.

Returns:

the Port object itself.

Applies to