]> git.basschouten.com Git - openhab-addons.git/blob
633960006b2fa67ae6acb70cb44bdeb8212c6ddf
[openhab-addons.git] /
1 /**
2  * Copyright (c) 2010-2021 Contributors to the openHAB project
3  *
4  * See the NOTICE file(s) distributed with this work for additional
5  * information.
6  *
7  * This program and the accompanying materials are made available under the
8  * terms of the Eclipse Public License 2.0 which is available at
9  * http://www.eclipse.org/legal/epl-2.0
10  *
11  * SPDX-License-Identifier: EPL-2.0
12  */
13 package org.openhab.binding.lifx.internal;
14
15 import java.util.concurrent.ScheduledExecutorService;
16
17 import org.eclipse.jdt.annotation.NonNullByDefault;
18 import org.openhab.binding.lifx.internal.handler.LifxLightHandler;
19 import org.openhab.binding.lifx.internal.handler.LifxLightHandler.CurrentLightState;
20
21 /**
22  * The {@link LifxLightContext} shares the context of a light with {@link LifxLightHandler} helper objects.
23  *
24  * @author Wouter Born - Initial contribution
25  */
26 @NonNullByDefault
27 public class LifxLightContext {
28
29     private final String logId;
30     private final LifxLightConfig configuration;
31     private final CurrentLightState currentLightState;
32     private final LifxLightState pendingLightState;
33     private final LifxProduct product;
34     private final ScheduledExecutorService scheduler;
35
36     public LifxLightContext(String logId, LifxProduct product, LifxLightConfig configuration,
37             CurrentLightState currentLightState, LifxLightState pendingLightState, ScheduledExecutorService scheduler) {
38         this.logId = logId;
39         this.configuration = configuration;
40         this.product = product;
41         this.currentLightState = currentLightState;
42         this.pendingLightState = pendingLightState;
43         this.scheduler = scheduler;
44     }
45
46     public String getLogId() {
47         return logId;
48     }
49
50     public LifxLightConfig getConfiguration() {
51         return configuration;
52     }
53
54     public LifxProduct getProduct() {
55         return product;
56     }
57
58     public CurrentLightState getCurrentLightState() {
59         return currentLightState;
60     }
61
62     public LifxLightState getPendingLightState() {
63         return pendingLightState;
64     }
65
66     public ScheduledExecutorService getScheduler() {
67         return scheduler;
68     }
69 }