Class Error
java.lang.Object
com.azure.resourcemanager.appplatform.models.Error
- All Implemented Interfaces:
com.azure.json.JsonSerializable<Error>
The error code compose of code and message.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncode()Get the code property: The code of error.static ErrorfromJson(com.azure.json.JsonReader jsonReader) Reads an instance of Error from the JsonReader.message()Get the message property: The message of error.com.azure.json.JsonWritertoJson(com.azure.json.JsonWriter jsonWriter) voidvalidate()Validates the instance.Set the code property: The code of error.withMessage(String message) Set the message property: The message of error.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.azure.json.JsonSerializable
toJson, toJson, toJsonBytes, toJsonString
-
Constructor Details
-
Error
public Error()Creates an instance of Error class.
-
-
Method Details
-
code
Get the code property: The code of error.- Returns:
- the code value.
-
withCode
Set the code property: The code of error.- Parameters:
code- the code value to set.- Returns:
- the Error object itself.
-
message
Get the message property: The message of error.- Returns:
- the message value.
-
withMessage
Set the message property: The message of error.- Parameters:
message- the message value to set.- Returns:
- the Error object itself.
-
validate
public void validate()Validates the instance.- Throws:
IllegalArgumentException- thrown if the instance is not valid.
-
toJson
- Specified by:
toJsonin interfacecom.azure.json.JsonSerializable<Error>- Throws:
IOException
-
fromJson
Reads an instance of Error from the JsonReader.- Parameters:
jsonReader- The JsonReader being read.- Returns:
- An instance of Error 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 Error.
-