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.gl.businessobject;
017    
018    /**
019     * A class that holds an error message that would have been encountered during a GL batch job
020     */
021    public class ScrubberMessage {
022        /**
023         * To mark Fatal errors, ones that should abend a batch process
024         */
025        public static int TYPE_FATAL = 1;
026        /**
027         * To mark warning errors, ones that should simply be logged but not abend the process
028         */
029        public static int TYPE_WARNING = 0;
030    
031        private String message;
032        private int type;
033    
034        /**
035         * Constructs a ScrubberMessage instance
036         * @param m the message
037         * @param t the type of message
038         */
039        public ScrubberMessage(String m, int t) {
040            message = m;
041            type = t;
042        }
043    
044        /**
045         * Returns the message
046         * @see java.lang.Object#toString()
047         */
048        public String toString() {
049            return message;
050        }
051    
052        /**
053         * Returns the error message of this object
054         * 
055         * @return the error message held by this object
056         */
057        public String getMessage() {
058            return message;
059        }
060    
061        /**
062         * Sets the error message for this object
063         * @param message the message to set
064         */
065        public void setMessage(String message) {
066            this.message = message;
067        }
068    
069        /**
070         * Returns the error type for this object 
071         * 
072         * @return the error type of this object
073         */
074        public int getType() {
075            return type;
076        }
077    
078        /**
079         * Sets the error type for this object
080         * 
081         * @param type an error type to set
082         */
083        public void setType(int type) {
084            this.type = type;
085        }
086    
087    
088    }