01: /*
02: * $Id: Message.java 8077 2007-08-27 20:15:25Z aperepel $
03: * --------------------------------------------------------------------------------------
04: * Copyright (c) MuleSource, Inc. All rights reserved. http://www.mulesource.com
05: *
06: * The software in this package is published under the terms of the CPAL v1.0
07: * license, a copy of which has been included with this distribution in the
08: * LICENSE.txt file.
09: */
10:
11: package org.mule.config.i18n;
12:
13: import java.io.Serializable;
14:
15: public class Message implements Serializable {
16: /**
17: * Serial version
18: */
19: private static final long serialVersionUID = -6109760447384477924L;
20:
21: private String message;
22: private int code = 0;
23: private Object[] args;
24: private Message nextMessage;
25:
26: protected Message(String message, int code, Object[] args) {
27: super ();
28: this .message = message;
29: this .code = code;
30: this .args = args;
31: }
32:
33: public int getCode() {
34: return code;
35: }
36:
37: public Object[] getArgs() {
38: return args;
39: }
40:
41: public String getMessage() {
42: return message
43: + (nextMessage != null ? ". "
44: + nextMessage.getMessage() : "");
45: }
46:
47: public Message setNextMessage(Message nextMessage) {
48: this .nextMessage = nextMessage;
49: return this ;
50: }
51:
52: public Message getNextMessage() {
53: return nextMessage;
54: }
55:
56: public String toString() {
57: return this.getMessage();
58: }
59: }
|