View Javadoc
1   package org.kuali.common.util.log.log4j.jaxb;
2   
3   import javax.xml.bind.annotation.adapters.XmlAdapter;
4   
5   import org.kuali.common.util.log.log4j.model.Threshold;
6   
7   public class RepositoryThresholdAdapter extends XmlAdapter<String, Threshold> {
8   
9   	@Override
10  	public final String marshal(Threshold threshold) {
11  		if (Threshold.DEFAULT_REPOSITORY_VALUE.equals(threshold)) {
12  			return null;
13  		} else {
14  			return threshold.name().toLowerCase();
15  		}
16  	}
17  
18  	@Override
19  	public final Threshold unmarshal(String threshold) {
20  		if (threshold == null) {
21  			return Threshold.DEFAULT_REPOSITORY_VALUE;
22  		} else {
23  			return Threshold.valueOf(threshold.toUpperCase());
24  		}
25  	}
26  
27  }