View Javadoc

1   package org.kuali.common.util.log.log4j.model;
2   
3   import java.util.ArrayList;
4   import java.util.Collections;
5   import java.util.List;
6   
7   import javax.xml.bind.annotation.XmlAttribute;
8   import javax.xml.bind.annotation.XmlElement;
9   
10  import org.kuali.common.util.Assert;
11  import org.kuali.common.util.CollectionUtils;
12  import org.kuali.common.util.nullify.Null;
13  
14  public final class Layout {
15  
16  	public static final Layout NONE = new Layout();
17  
18  	@XmlAttribute(name = "class")
19  	private final Class<?> layoutClass;
20  
21  	@XmlElement(name = "param")
22  	private final List<Param> params;
23  
24  	private Layout() {
25  		this(Null.class, Param.EMPTY);
26  	}
27  
28  	public Layout(Class<?> layoutClass, Param param) {
29  		this(layoutClass, CollectionUtils.singletonList(param));
30  	}
31  
32  	public Layout(Class<?> layoutClass, List<Param> params) {
33  		Assert.noNulls(layoutClass, params);
34  		this.layoutClass = layoutClass;
35  		this.params = new ArrayList<Param>(params);
36  	}
37  
38  	public List<Param> getParams() {
39  		return Collections.unmodifiableList(params);
40  	}
41  
42  	public Class<?> getLayoutClass() {
43  		return layoutClass;
44  	}
45  
46  }