java.lang.Object
com.azure.core.management.SubResource
com.azure.resourcemanager.compute.models.NetworkInterfaceReference
- All Implemented Interfaces:
com.azure.json.JsonSerializable<com.azure.core.management.SubResource>
public final class NetworkInterfaceReference
extends com.azure.core.management.SubResource
Describes a network interface reference.
-
Constructor Summary
Constructors
Creates an instance of NetworkInterfaceReference class.
-
Method Summary
Get the deleteOption property: Specify what happens to the network interface when the VM is deleted.
fromJson(com.azure.json.JsonReader jsonReader)
Reads an instance of NetworkInterfaceReference from the JsonReader.
Get the primary property: Specifies the primary network interface in case the virtual machine has more than 1
network interface.
com.azure.json.JsonWriter
toJson(com.azure.json.JsonWriter jsonWriter)
void
Set the deleteOption property: Specify what happens to the network interface when the VM is deleted.
Set the primary property: Specifies the primary network interface in case the virtual machine has more than 1
network interface.
Methods inherited from class com.azure.core.management.SubResource
id
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.azure.json.JsonSerializable
toJson, toJson, toJsonBytes, toJsonString
-
Constructor Details
-
NetworkInterfaceReference
public NetworkInterfaceReference()
Creates an instance of NetworkInterfaceReference class.
-
Method Details
-
withId
- Overrides:
withId in class com.azure.core.management.SubResource
-
primary
Get the primary property: Specifies the primary network interface in case the virtual machine has more than 1
network interface.
- Returns:
- the primary value.
-
withPrimary
Set the primary property: Specifies the primary network interface in case the virtual machine has more than 1
network interface.
- Parameters:
primary - the primary value to set.
- Returns:
- the NetworkInterfaceReference object itself.
-
deleteOption
Get the deleteOption property: Specify what happens to the network interface when the VM is deleted.
- Returns:
- the deleteOption value.
-
withDeleteOption
Set the deleteOption property: Specify what happens to the network interface when the VM is deleted.
- Parameters:
deleteOption - the deleteOption value to set.
- Returns:
- the NetworkInterfaceReference object itself.
-
validate
public void validate()
Validates the instance.
- Throws:
IllegalArgumentException - thrown if the instance is not valid.
-
toJson
public com.azure.json.JsonWriter toJson(com.azure.json.JsonWriter jsonWriter)
throws IOException
- Specified by:
toJson in interface com.azure.json.JsonSerializable<com.azure.core.management.SubResource>
- Overrides:
toJson in class com.azure.core.management.SubResource
- Throws:
IOException
-
fromJson
Reads an instance of NetworkInterfaceReference from the JsonReader.
- Parameters:
jsonReader - The JsonReader being read.
- Returns:
- An instance of NetworkInterfaceReference 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 NetworkInterfaceReference.