1package org.apache.archiva.redback.rest.api.model;
2/*3 * Licensed to the Apache Software Foundation (ASF) under one4 * or more contributor license agreements. See the NOTICE file5 * distributed with this work for additional information6 * regarding copyright ownership. The ASF licenses this file7 * to you under the Apache License, Version 2.0 (the8 * "License"); you may not use this file except in compliance9 * with the License. You may obtain a copy of the License at10 *11 * http://www.apache.org/licenses/LICENSE-2.012 *13 * Unless required by applicable law or agreed to in writing,14 * software distributed under the License is distributed on an15 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY16 * KIND, either express or implied. See the License for the17 * specific language governing permissions and limitations18 * under the License.19 */2021import javax.xml.bind.annotation.XmlRootElement;
22import java.io.Serializable;
2324/**25 * @author Olivier Lamy26 * @since 1.427 */28 @XmlRootElement( name = "errorMessage" )
29publicclassErrorMessage30implements Serializable
31 {
32private String errorKey;
3334private String[] args;
3536/**37 * @since 2.1 for message without any key38 */39private String message;
4041privatestaticfinal String[] EMPTY = new String[0];
4243publicErrorMessage()
44 {
45// no op46 }
4748publicErrorMessage( String errorKey )
49 {
50this.errorKey = errorKey;
51this.args = EMPTY;
52 }
5354publicErrorMessage( String errorKey, String[] args )
55 {
56this.errorKey = errorKey;
57this.args = args;
58 }
5960public String getErrorKey()
61 {
62return errorKey;
63 }
6465publicvoid setErrorKey( String errorKey )
66 {
67this.errorKey = errorKey;
68 }
6970public String[] getArgs()
71 {
72return args;
73 }
7475publicvoid setArgs( String[] args )
76 {
77this.args = args;
78 }
7980public String getMessage()
81 {
82return message;
83 }
8485publicvoid setMessage( String message )
86 {
87this.message = message;
88 }
8990publicErrorMessage message( String message )
91 {
92this.message = message;
93returnthis;
94 }
95 }