]> git.basschouten.com Git - openhab-addons.git/blob
0614a00c040bd217e74438edab6f0ad7219706b6
[openhab-addons.git] /
1 /**
2  * Copyright (c) 2010-2023 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.paradoxalarm.internal.model;
14
15 import org.slf4j.Logger;
16 import org.slf4j.LoggerFactory;
17
18 /**
19  * The {@link Entity} Entity - base abstract class for Paradox entities (Partitions, zones, etc).
20  * Extend this class and add entity specific data (states, troubles, etc).
21  *
22  * @author Konstantin Polihronov - Initial contribution
23  */
24 public abstract class Entity {
25     private final Logger logger = LoggerFactory.getLogger(Entity.class);
26
27     private ParadoxPanel panel;
28     private int id;
29     private String label;
30
31     public Entity(ParadoxPanel panel, int id, String label) {
32         this.panel = panel;
33         this.id = id;
34         this.label = label.trim();
35         logger.debug("Creating entity with label: {} and ID: {}", label, id);
36     }
37
38     public int getId() {
39         return id;
40     }
41
42     public void setId(int id) {
43         this.id = id;
44     }
45
46     public String getLabel() {
47         return label;
48     }
49
50     public void setLabel(String label) {
51         this.label = label;
52     }
53
54     public ParadoxPanel getPanel() {
55         return panel;
56     }
57
58     @Override
59     public String toString() {
60         return "Entity [id=" + id + ", label=" + label + "]";
61     }
62 }