public class GoogleJsonError extends GenericJson
Modifier and Type | Class and Description |
---|---|
static class |
GoogleJsonError.Details |
static class |
GoogleJsonError.ErrorInfo
Detailed error information.
|
static class |
GoogleJsonError.ParameterViolations |
GenericData.Flags
AbstractMap.SimpleEntry<K,V>, AbstractMap.SimpleImmutableEntry<K,V>
Constructor and Description |
---|
GoogleJsonError() |
Modifier and Type | Method and Description |
---|---|
GoogleJsonError |
clone() |
int |
getCode()
Returns the HTTP status code of this response or
null for none. |
List<GoogleJsonError.Details> |
getDetails() |
List<GoogleJsonError.ErrorInfo> |
getErrors()
Returns the list of detailed errors or
null for none. |
String |
getMessage()
Returns the human-readable explanation of the error or
null for none. |
static GoogleJsonError |
parse(JsonFactory jsonFactory,
HttpResponse response)
Parses the given error HTTP response using the given JSON factory.
|
GoogleJsonError |
set(String fieldName,
Object value) |
void |
setCode(int code)
Sets the HTTP status code of this response or
null for none. |
void |
setDetails(List<GoogleJsonError.Details> details)
Sets the list of invalid parameter error details as immutable to prevent exposing mutable
state.
|
void |
setErrors(List<GoogleJsonError.ErrorInfo> errors)
Sets the list of detailed errors or
null for none. |
void |
setMessage(String message)
Sets the human-readable explanation of the error or
null for none. |
getFactory, setFactory, toPrettyString, toString
entrySet, equals, get, getClassInfo, getUnknownKeys, hashCode, put, putAll, remove, setUnknownKeys
clear, containsKey, containsValue, isEmpty, keySet, size, values
finalize, getClass, notify, notifyAll, wait, wait, wait
compute, computeIfAbsent, computeIfPresent, forEach, getOrDefault, merge, putIfAbsent, remove, replace, replace, replaceAll
public static GoogleJsonError parse(JsonFactory jsonFactory, HttpResponse response) throws IOException
jsonFactory
- JSON factoryresponse
- HTTP responseIllegalArgumentException
- if content type is not Json.MEDIA_TYPE
or if expected
"data"
or "error"
key is not foundIOException
public final List<GoogleJsonError.ErrorInfo> getErrors()
null
for none.public final void setErrors(List<GoogleJsonError.ErrorInfo> errors)
null
for none. Sets the list of detailed errors as
immutable to prevent exposing mutable state.public final int getCode()
null
for none.public final void setCode(int code)
null
for none.public final String getMessage()
null
for none.public final void setMessage(String message)
null
for none.public List<GoogleJsonError.Details> getDetails()
public void setDetails(List<GoogleJsonError.Details> details)
details
- public GoogleJsonError set(String fieldName, Object value)
set
in class GenericJson
public GoogleJsonError clone()
clone
in class GenericJson
Copyright © 2010–2022 Google. All rights reserved.