java.lang.Object
com.azure.resourcemanager.privatedns.models.MxRecord
All Implemented Interfaces:
com.azure.json.JsonSerializable<MxRecord>

public final class MxRecord extends Object implements com.azure.json.JsonSerializable<MxRecord>
An MX record.
  • Constructor Summary

    Constructors
    Constructor
    Description
    Creates an instance of MxRecord class.
  • Method Summary

    Modifier and Type
    Method
    Description
    Get the exchange property: The domain name of the mail host for this MX record.
    static MxRecord
    fromJson(com.azure.json.JsonReader jsonReader)
    Reads an instance of MxRecord from the JsonReader.
    Get the preference property: The preference value for this MX record.
    com.azure.json.JsonWriter
    toJson(com.azure.json.JsonWriter jsonWriter)
    void
    Validates the instance.
    withExchange(String exchange)
    Set the exchange property: The domain name of the mail host for this MX record.
    withPreference(Integer preference)
    Set the preference property: The preference value for this MX record.

    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

    • MxRecord

      public MxRecord()
      Creates an instance of MxRecord class.
  • Method Details

    • preference

      public Integer preference()
      Get the preference property: The preference value for this MX record.
      Returns:
      the preference value.
    • withPreference

      public MxRecord withPreference(Integer preference)
      Set the preference property: The preference value for this MX record.
      Parameters:
      preference - the preference value to set.
      Returns:
      the MxRecord object itself.
    • exchange

      public String exchange()
      Get the exchange property: The domain name of the mail host for this MX record.
      Returns:
      the exchange value.
    • withExchange

      public MxRecord withExchange(String exchange)
      Set the exchange property: The domain name of the mail host for this MX record.
      Parameters:
      exchange - the exchange value to set.
      Returns:
      the MxRecord 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<MxRecord>
      Throws:
      IOException
    • fromJson

      public static MxRecord fromJson(com.azure.json.JsonReader jsonReader) throws IOException
      Reads an instance of MxRecord from the JsonReader.
      Parameters:
      jsonReader - The JsonReader being read.
      Returns:
      An instance of MxRecord 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 MxRecord.