ContainerPort Class

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

Implements

public final class ContainerPort
implements JsonSerializable<ContainerPort>

The port exposed on the container instance.

Constructor Summary

Constructor Description
ContainerPort()

Creates an instance of ContainerPort class.

Method Summary

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

Reads an instance of ContainerPort from the JsonReader.

int port()

Get the port property: The port number exposed within the container group.

ContainerNetworkProtocol protocol()

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

JsonWriter toJson(JsonWriter jsonWriter)
void validate()

Validates the instance.

ContainerPort withPort(int port)

Set the port property: The port number exposed within the container group.

ContainerPort withProtocol(ContainerNetworkProtocol protocol)

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

Methods inherited from java.lang.Object

Constructor Details

ContainerPort

public ContainerPort()

Creates an instance of ContainerPort class.

Method Details

fromJson

public static ContainerPort fromJson(JsonReader jsonReader)

Reads an instance of ContainerPort from the JsonReader.

Parameters:

jsonReader - The JsonReader being read.

Returns:

An instance of ContainerPort 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 exposed within the container group.

Returns:

the port value.

protocol

public ContainerNetworkProtocol 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 ContainerPort withPort(int port)

Set the port property: The port number exposed within the container group.

Parameters:

port - the port value to set.

Returns:

the ContainerPort object itself.

withProtocol

public ContainerPort withProtocol(ContainerNetworkProtocol protocol)

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

Parameters:

protocol - the protocol value to set.

Returns:

the ContainerPort object itself.

Applies to