-
Notifications
You must be signed in to change notification settings - Fork 16
/
BasicSetupResourceSettingSpecifier.java
77 lines (68 loc) · 2.22 KB
/
BasicSetupResourceSettingSpecifier.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
/* ==================================================================
* BasicSetupResourceSettingSpecifier.java - 21/09/2016 12:36:54 PM
*
* Copyright 2007-2016 SolarNetwork.net Dev Team
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2 of
* the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
* 02111-1307 USA
* ==================================================================
*/
package net.solarnetwork.node.settings.support;
import java.util.Map;
import net.solarnetwork.node.settings.SetupResourceSettingSpecifier;
import net.solarnetwork.node.setup.SetupResourceProvider;
import net.solarnetwork.settings.support.BaseSettingSpecifier;
/**
* Basic implementation of {@link SetupResourceSettingSpecifier}.
*
* @author matt
* @version 2.0
*/
public class BasicSetupResourceSettingSpecifier extends BaseSettingSpecifier
implements SetupResourceSettingSpecifier {
private final SetupResourceProvider provider;
private final Map<String, ?> props;
/**
* Construct without properties.
*
* @param provider
* The provider to use.
*/
public BasicSetupResourceSettingSpecifier(SetupResourceProvider provider) {
this(provider, null);
}
/**
* Constructor.
*
* @param provider
* The provider to use.
* @param properties
* The properties to use.
*/
public BasicSetupResourceSettingSpecifier(SetupResourceProvider provider,
Map<String, ?> properties) {
super();
this.provider = provider;
this.props = properties;
}
@Override
public SetupResourceProvider getSetupResourceProvider() {
return provider;
}
@Override
public Map<String, ?> getSetupResourceProperties() {
return props;
}
}