2 * Copyright (c) 2010-2023 Contributors to the openHAB project
4 * See the NOTICE file(s) distributed with this work for additional
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
11 * SPDX-License-Identifier: EPL-2.0
13 package org.openhab.binding.digitalstrom.internal.lib.structure.devices.deviceparameters.impl;
16 * The {@link DSUID} represents the digitalSTROM-Device unique identifier.
18 * @author Alexander Friese - Initial contribution
22 private final String dsuid;
23 private static final String DEFAULT_DSUID = "3504175fe0000000000000000000000001";
26 * Creates a new {@link DSUID}.
28 * @param dsuid to create
30 public DSUID(String dsuid) {
31 var trimmedDsuid = dsuid != null ? dsuid.trim() : "";
32 if (trimmedDsuid.length() == 34) {
33 this.dsuid = trimmedDsuid;
35 this.dsuid = DEFAULT_DSUID;
40 * Returns the dSUID as {@link String}.
44 public String getValue() {
49 public boolean equals(Object obj) {
50 if (obj instanceof DSUID) {
51 return ((DSUID) obj).getValue().equals(this.getValue());
57 public int hashCode() {
58 return dsuid.hashCode();
62 public String toString() {