1 package org.kuali.common.util.log.log4j; 2 3 import java.io.File; 4 5 import org.kuali.common.util.file.CanonicalFile; 6 import org.kuali.common.util.log.log4j.model.Param; 7 import org.kuali.common.util.log.log4j.model.Threshold; 8 9 public class ParamFactory { 10 11 public static final String CONVERSION_PATTERN = "ConversionPattern"; 12 public static final String FILE = "File"; 13 public static final String THRESHOLD = "Threshold"; 14 15 public static Param getPatternParam(String pattern) { 16 return new Param(CONVERSION_PATTERN, pattern); 17 } 18 19 public static Param getFileParam(String filename) { 20 return new Param(FILE, filename); 21 } 22 23 public static Param getFileParam(File file) { 24 return getFileParam(new CanonicalFile(file).getPath()); 25 } 26 27 public static Param getThresholdParam(Threshold threshold) { 28 return new Param(THRESHOLD, threshold.name()); 29 } 30 31 }