Add RFC 8040 compliant error handler
[ccsdk/apps.git] / services / src / main / java / org / onap / ccsdk / apps / services / RestErrors.java
1 package org.onap.ccsdk.apps.services;
2
3 import com.fasterxml.jackson.annotation.JsonRootName;
4
5 import java.util.LinkedList;
6 import java.util.List;
7
8 @JsonRootName(value="errors")
9 public class RestErrors {
10     List<RestError> errors;
11
12     public RestErrors()
13     {
14         this.errors = new LinkedList<RestError>();
15     }
16
17     public RestErrors(RestError error) {
18         this.errors = new LinkedList<RestError>();
19         errors.add(error);
20     }
21     public void addError(RestError error) {
22         errors.add(error);
23     }
24
25     public List<RestError> getErrors() {
26         return errors;
27     }
28 }