]> git.basschouten.com Git - openhab-addons.git/blob
1d297f0a52812cafff5abe7319bc80899ec12f29
[openhab-addons.git] /
1 /**
2  * Copyright (c) 2010-2024 Contributors to the openHAB project
3  *
4  * See the NOTICE file(s) distributed with this work for additional
5  * information.
6  *
7  * This program and the accompanying materials are made available under the
8  * terms of the Eclipse Public License 2.0 which is available at
9  * http://www.eclipse.org/legal/epl-2.0
10  *
11  * SPDX-License-Identifier: EPL-2.0
12  */
13 package org.openhab.binding.amplipi.internal.model;
14
15 import java.util.ArrayList;
16 import java.util.List;
17
18 import io.swagger.v3.oas.annotations.media.Schema;
19
20 public class ValidationError {
21
22     @Schema(required = true)
23     private List<String> loc = new ArrayList<String>();
24
25     @Schema(required = true)
26     private String msg;
27
28     @Schema(required = true)
29     private String type;
30
31     /**
32      * Get loc
33      *
34      * @return loc
35      **/
36     public List<String> getLoc() {
37         return loc;
38     }
39
40     public void setLoc(List<String> loc) {
41         this.loc = loc;
42     }
43
44     public ValidationError loc(List<String> loc) {
45         this.loc = loc;
46         return this;
47     }
48
49     public ValidationError addLocItem(String locItem) {
50         this.loc.add(locItem);
51         return this;
52     }
53
54     /**
55      * Get msg
56      *
57      * @return msg
58      **/
59     public String getMsg() {
60         return msg;
61     }
62
63     public void setMsg(String msg) {
64         this.msg = msg;
65     }
66
67     public ValidationError msg(String msg) {
68         this.msg = msg;
69         return this;
70     }
71
72     /**
73      * Get type
74      *
75      * @return type
76      **/
77     public String getType() {
78         return type;
79     }
80
81     public void setType(String type) {
82         this.type = type;
83     }
84
85     public ValidationError type(String type) {
86         this.type = type;
87         return this;
88     }
89
90     @Override
91     public String toString() {
92         StringBuilder sb = new StringBuilder();
93         sb.append("class ValidationError {\n");
94
95         sb.append("    loc: ").append(toIndentedString(loc)).append("\n");
96         sb.append("    msg: ").append(toIndentedString(msg)).append("\n");
97         sb.append("    type: ").append(toIndentedString(type)).append("\n");
98         sb.append("}");
99         return sb.toString();
100     }
101
102     /**
103      * Convert the given object to string with each line indented by 4 spaces
104      * (except the first line).
105      */
106     private static String toIndentedString(Object o) {
107         if (o == null) {
108             return "null";
109         }
110         return o.toString().replace("\n", "\n    ");
111     }
112 }