Line | |
---|
1 | // License: GPL. For details, see LICENSE file.
|
---|
2 | package org.openstreetmap.josm.spi.preferences;
|
---|
3 |
|
---|
4 | import java.util.Objects;
|
---|
5 |
|
---|
6 | /**
|
---|
7 | * Class to hold the global preferences object.
|
---|
8 | * @since 12847
|
---|
9 | */
|
---|
10 | public class Config {
|
---|
11 |
|
---|
12 | private static IPreferences preferences;
|
---|
13 |
|
---|
14 | /**
|
---|
15 | * Get the preferences.
|
---|
16 | * @return the preferences
|
---|
17 | * @since 12847
|
---|
18 | */
|
---|
19 | public static IPreferences getPref() {
|
---|
20 | return preferences;
|
---|
21 | }
|
---|
22 |
|
---|
23 | /**
|
---|
24 | * Install the global preference instance.
|
---|
25 | * @param preferences the global preference instance to set (must not be null)
|
---|
26 | */
|
---|
27 | public static void setPreferencesInstance(IPreferences preferences) {
|
---|
28 | Config.preferences = Objects.requireNonNull(preferences, "preferences");
|
---|
29 | }
|
---|
30 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.