org.eclipse.dirigible.commons.api.helpers.AppExceptionMessage Maven / Gradle / Ivy
/*
* Copyright (c) 2017 SAP and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
* Contributors:
* SAP - initial API and implementation
*/
package org.eclipse.dirigible.commons.api.helpers;
import javax.ws.rs.core.Response.Status;
import javax.xml.bind.annotation.XmlRootElement;
/**
* Error message that is returned if an application error occur.
*/
@XmlRootElement
public class AppExceptionMessage {
private String message;
private int status;
/**
* Needed for serialization / de-serialization.
*/
public AppExceptionMessage() {
}
/**
* Default constructor.
*
* @param status
* the response server status.
* @param message
* the actual error message.
*/
public AppExceptionMessage(Status status, String message) {
this.status = status.getStatusCode();
this.message = message;
}
/**
* Gets the message.
*
* @return the error message.
*/
public String getMessage() {
return message;
}
/**
* Sets the error message.
*
* @param message
* the new message
*/
public void setMessage(String message) {
this.message = message;
}
/**
* Sets the server response status.
*
* @return the server response status.
*/
public int getStatus() {
return status;
}
/**
* Sets the status.
*
* @param status
* the server response status.
*/
public void setStatus(int status) {
this.status = status;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy