public class

RestErrors

extends RestMapEntity
java.lang.Object
   ↳ java.util.AbstractMap<K, V>
     ↳ java.util.HashMap<K, V>
       ↳ java.util.LinkedHashMap<K, V>
         ↳ com.atlassian.bitbucket.rest.RestMapEntity
           ↳ com.atlassian.bitbucket.rest.RestErrors

Summary

Nested Classes
class RestErrors.Builder  
Constants
String ERRORS
Fields
public static final RestErrors EXAMPLE
public static final RestErrors VALIDATION_EXAMPLE
Public Constructors
RestErrors()
RestErrors(Collection<RestErrorMessage> errors)
RestErrors(String error)
RestErrors(String context, String error)
Construct a RestErrors instance with a single error containing context and message.
RestErrors(ServiceException e)
RestErrors(RestErrorMessage message)
Public Methods
boolean endScopeAndTryWriteTo(StatefulJsonWriter writer)
Attempts to end the JSON scope of the supplied writer to a point where either an errors property can be added to the top-level object (where one exists) or a top level object can be added to the root with the errors property set (where no object, array or other value has already been added to the root yet).
List<RestErrorMessage> getErrors()
[Expand]
Inherited Methods
From class com.atlassian.bitbucket.rest.RestMapEntity
From class java.util.LinkedHashMap
From class java.util.HashMap
From class java.util.AbstractMap
From class java.lang.Object
From interface java.util.Map

Constants

public static final String ERRORS

Constant Value: "errors"

Fields

public static final RestErrors EXAMPLE

public static final RestErrors VALIDATION_EXAMPLE

Public Constructors

public RestErrors ()

public RestErrors (Collection<RestErrorMessage> errors)

public RestErrors (String error)

public RestErrors (String context, String error)

Construct a RestErrors instance with a single error containing context and message.

Parameters
context the error context
error error message

public RestErrors (ServiceException e)

public RestErrors (RestErrorMessage message)

Public Methods

public boolean endScopeAndTryWriteTo (StatefulJsonWriter writer)

Attempts to end the JSON scope of the supplied writer to a point where either an errors property can be added to the top-level object (where one exists) or a top level object can be added to the root with the errors property set (where no object, array or other value has already been added to the root yet). If this is not possible due the current JSON object context and element count, false is returned. Regardless of the return result, after calling this method the JSON writer's context will be set to the root.

Parameters
writer the JSON writer to end scope and attempt to write the error to
Returns
  • true if the error property could be written, false otherwise
Throws
IOException if there is an IO exception from the underlying JSON writer

public List<RestErrorMessage> getErrors ()