001 /*
002 * Copyright 2011 The Kuali Foundation.
003 *
004 * Licensed under the Educational Community License, Version 2.0 (the "License");
005 * you may not use this file except in compliance with the License.
006 * You may obtain a copy of the License at
007 *
008 * http://www.opensource.org/licenses/ecl2.php
009 *
010 * Unless required by applicable law or agreed to in writing, software
011 * distributed under the License is distributed on an "AS IS" BASIS,
012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
013 * See the License for the specific language governing permissions and
014 * limitations under the License.
015 */
016 package org.kuali.kfs.sys;
017
018
019 /**
020 * This class represents an error message (severity type and actual message).
021 */
022 public class Message {
023 public static final int TYPE_FATAL = 1;
024 public static final int TYPE_WARNING = 0;
025
026 private String message;
027 private int type;
028
029 public Message(String m, int t, Object... args) {
030 message = String.format(m, args);
031 type = t;
032 }
033
034 public Message(String m, int t) {
035 message = m;
036 type = t;
037 }
038
039 public String toString() {
040 return message;
041 }
042
043 public String getMessage() {
044 return message;
045 }
046
047 public void setMessage(String message) {
048 this.message = message;
049 }
050
051 public int getType() {
052 return type;
053 }
054
055 public void setType(int type) {
056 this.type = type;
057 }
058 }