Package com.codebarrel.api
Class ErrorCollectionImpl
java.lang.Object
com.codebarrel.api.ErrorCollectionImpl
- All Implemented Interfaces:
ErrorCollection
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionAdds to the error map.addErrorMessage(String errorMessage) Appends error messageaddErrorMessages(Collection<String> messages) addErrors(ErrorCollection errorCollection) Appends error messages and add the error map.addWarningMessages(Collection<String> messages) Returns an error message, this is only set through JSONError key/values on the collectionintbooleanDoes this contain any field errors or messagesvoidsetStatus(int status) Sets the HTTP status code for the errortoString()
-
Constructor Details
-
ErrorCollectionImpl
public ErrorCollectionImpl()
-
-
Method Details
-
addErrors
Description copied from interface:ErrorCollectionAppends error messages and add the error map. This over-writes the errors map for any duplicate key Warning: This method does not currently copy across error status, ensure that it set properly before using this- Specified by:
addErrorsin interfaceErrorCollection
-
addErrors
- Specified by:
addErrorsin interfaceErrorCollection
-
addError
Description copied from interface:ErrorCollectionAdds to the error map. This over-writes for any duplicate key- Specified by:
addErrorin interfaceErrorCollection
-
addErrorMessage
Description copied from interface:ErrorCollectionAppends error message- Specified by:
addErrorMessagein interfaceErrorCollection
-
addErrorMessages
- Specified by:
addErrorMessagesin interfaceErrorCollection
-
addWarningMessages
- Specified by:
addWarningMessagesin interfaceErrorCollection
-
setStatus
public void setStatus(int status) Description copied from interface:ErrorCollectionSets the HTTP status code for the error- Specified by:
setStatusin interfaceErrorCollection
-
hasAnyErrors
public boolean hasAnyErrors()Description copied from interface:ErrorCollectionDoes this contain any field errors or messages- Specified by:
hasAnyErrorsin interfaceErrorCollection
-
getErrorMessages
- Specified by:
getErrorMessagesin interfaceErrorCollection
-
getMessage
-
getWarningMessages
- Specified by:
getWarningMessagesin interfaceErrorCollection
-
getErrors
Description copied from interface:ErrorCollectionError key/values on the collection- Specified by:
getErrorsin interfaceErrorCollection- Returns:
- Unmodified map of errors. Use addError for any mutations
-
getErrorMessage
Description copied from interface:ErrorCollectionReturns an error message, this is only set through JSON- Specified by:
getErrorMessagein interfaceErrorCollection
-
getStatus
public int getStatus()- Specified by:
getStatusin interfaceErrorCollection
-
toString
-