001package org.kuali.common.util.log.log4j.jaxb;
002
003import javax.xml.bind.annotation.adapters.XmlAdapter;
004
005import org.kuali.common.util.log.log4j.model.Debug;
006
007public class DebugAdapter extends XmlAdapter<String, Debug> {
008
009        @Override
010        public final String marshal(Debug value) {
011                if (Debug.DEFAULT_VALUE.equals(value)) {
012                        return null;
013                } else {
014                        return value.name().toLowerCase();
015                }
016        }
017
018        @Override
019        public final Debug unmarshal(String value) {
020                if (value == null) {
021                        return Debug.DEFAULT_VALUE;
022                } else {
023                        return Debug.valueOf(value.toUpperCase());
024                }
025        }
026
027}