1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.kuali.common.util.service;
17
18 import java.util.List;
19
20 import org.springframework.core.env.PropertySource;
21
22 public class PropertySourceContext {
23
24 public static final boolean DEFAULT_REMOVE_EXISTING_SOURCES = false;
25 public static final boolean DEFAULT_LAST_ONE_IN_WINS = true;
26 public static final PropertySourceAddPriority DEFAULT_PRIORITY = PropertySourceAddPriority.LAST;
27
28
29 boolean removeExistingSources = DEFAULT_REMOVE_EXISTING_SOURCES;
30
31
32
33 boolean lastOneInWins = DEFAULT_LAST_ONE_IN_WINS;
34
35
36 PropertySourceAddPriority priority = DEFAULT_PRIORITY;
37
38
39 List<PropertySource<?>> sources;
40
41 public PropertySourceContext() {
42 this(null);
43 }
44
45 public PropertySourceContext(List<PropertySource<?>> sources) {
46 this(sources, DEFAULT_REMOVE_EXISTING_SOURCES);
47 }
48
49 public PropertySourceContext(List<PropertySource<?>> sources, boolean removeExistingSources) {
50 super();
51 this.sources = sources;
52 this.removeExistingSources = removeExistingSources;
53 }
54
55 public boolean isRemoveExistingSources() {
56 return removeExistingSources;
57 }
58
59 public void setRemoveExistingSources(boolean removeExistingSources) {
60 this.removeExistingSources = removeExistingSources;
61 }
62
63 public boolean isLastOneInWins() {
64 return lastOneInWins;
65 }
66
67 public void setLastOneInWins(boolean lastOneInWins) {
68 this.lastOneInWins = lastOneInWins;
69 }
70
71 public List<PropertySource<?>> getSources() {
72 return sources;
73 }
74
75 public void setSources(List<PropertySource<?>> sources) {
76 this.sources = sources;
77 }
78
79 public PropertySourceAddPriority getPriority() {
80 return priority;
81 }
82
83 public void setPriority(PropertySourceAddPriority priority) {
84 this.priority = priority;
85 }
86
87 }