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