]> git.basschouten.com Git - openhab-addons.git/blob
07d6e91a78faab2cea15a1c4ab1d06677a35ae24
[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.pulseaudio.internal.items;
14
15 /**
16  * Abstract root class for all items in an pulseaudio server. Every item in a
17  * pulseaudio server has a name and a unique id which can be inherited by this
18  * class.
19  *
20  * @author Tobias Bräutigam - Initial contribution
21  */
22 public abstract class AbstractDeviceConfig {
23
24     protected int id;
25     protected String name;
26
27     public AbstractDeviceConfig(int id, String name) {
28         this.id = id;
29         this.name = name;
30     }
31
32     /**
33      * returns the internal id of this device
34      *
35      * @return
36      */
37     public int getId() {
38         return id;
39     }
40
41     public String getUIDName() {
42         return name.replaceAll("[^A-Za-z0-9_]", "_");
43     }
44
45     public String getPaName() {
46         return name;
47     }
48 }