diff options
author | Ofir Sonsino <os0695@intl.att.com> | 2018-08-20 11:19:09 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@onap.org> | 2018-08-20 11:19:09 +0000 |
commit | 6447784fdd770e8a2b4ef2c52ba206d35c0fd325 (patch) | |
tree | dfbca02ef1e5e069c9b817cd071ffd749f8db3ed /vid-automation/src/test/java/org/onap/vid/model/mso/ExceptionResponse.java | |
parent | 09e4dff67bed925ec1bcd5f4164a305951191408 (diff) | |
parent | 94c46cf460196b5d1da27326989781ab0955666e (diff) |
Merge "Renaming vid-automation #7"
Diffstat (limited to 'vid-automation/src/test/java/org/onap/vid/model/mso/ExceptionResponse.java')
-rw-r--r-- | vid-automation/src/test/java/org/onap/vid/model/mso/ExceptionResponse.java | 87 |
1 files changed, 87 insertions, 0 deletions
diff --git a/vid-automation/src/test/java/org/onap/vid/model/mso/ExceptionResponse.java b/vid-automation/src/test/java/org/onap/vid/model/mso/ExceptionResponse.java new file mode 100644 index 000000000..6801af2b5 --- /dev/null +++ b/vid-automation/src/test/java/org/onap/vid/model/mso/ExceptionResponse.java @@ -0,0 +1,87 @@ +/*- + * ============LICENSE_START======================================================= + * VID + * ================================================================================ + * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END========================================================= + */ + +package org.onap.vid.model.mso; + +/** + * The Class ExceptionResponse. + */ +public class ExceptionResponse { + + public ExceptionResponse() { + } + + /** The exception. */ + private String exception; + + /** The message. */ + private String message; + + public ExceptionResponse(String exception, String message) { + this.exception = exception; + this.message = message; + } + + public ExceptionResponse(Exception exception) { + setException(exception); + } + + /** + * Gets the exception. + * + * @return the exception + */ + public String getException() { + return exception; + } + + /** + * Sets the exception. + * + * @param exception the new exception + */ + public void setException(String exception) { + this.exception = exception; + } + + public void setException(Exception exception) { + setException(exception.getClass().toString().replaceFirst("^.*[\\.$]", "")); + setMessage(exception.getMessage()); + } + + /** + * Gets the message. + * + * @return the message + */ + public String getMessage() { + return message; + } + + /** + * Sets the message. + * + * @param message the new message + */ + public void setMessage(String message) { + this.message = message; + } + +} |