]> git.basschouten.com Git - openhab-addons.git/blob
7ddbac3fff57b0d4743fb994b1a0cf63bb27633b
[openhab-addons.git] /
1 /**
2  * Copyright (c) 2010-2022 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 int id;
28     private String label;
29
30     public Entity(int id, String label) {
31         this.id = id;
32         this.label = label.trim();
33         logger.debug("Creating entity with label: {} and ID: {}", label, id);
34     }
35
36     public int getId() {
37         return id;
38     }
39
40     public void setId(int id) {
41         this.id = id;
42     }
43
44     public String getLabel() {
45         return label;
46     }
47
48     public void setLabel(String label) {
49         this.label = label;
50     }
51
52     @Override
53     public String toString() {
54         return "Entity [id=" + id + ", label=" + label + "]";
55     }
56 }