aboutsummaryrefslogtreecommitdiff
path: root/src/org/traccar/web/client/Context.java
blob: 6cc6f0c4f0b2276e228e22c9d56a073555f802f3 (plain)
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
package org.traccar.web.client;

import org.traccar.web.shared.model.ApplicationSettings;
import org.traccar.web.shared.model.UserSettings;

public class Context {

    private static final Context context = new Context();

    public Context getInstance() {
        return context;
    }

    private ApplicationSettings applicationSettings;

    public void setApplicationSettings(ApplicationSettings applicationSettings) {
        this.applicationSettings = applicationSettings;
    }

    public ApplicationSettings getApplicationSettings() {
        if (applicationSettings != null) {
            return applicationSettings;
        } else {
            return new ApplicationSettings(); // default settings
        }
    }

    private UserSettings userSettings;

    public void setUserSettings(UserSettings userSettings) {
        this.userSettings = userSettings;
    }

    public UserSettings getUserSettings() {
        if (userSettings != null) {
            return userSettings;
        } else {
            return new UserSettings(); // default settings
        }
    }

}