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.dsmr.internal.device.cosem;
15 import org.eclipse.jdt.annotation.NonNullByDefault;
16 import org.openhab.core.library.types.StringType;
19 * {@link CosemString} represents a string value.
21 * @author M. Volaart - Initial contribution
22 * @author Hilbrand Bouwkamp - Class now a factory instead of data containing class
25 class CosemString extends CosemValueDescriptor<StringType> {
27 public static final CosemString INSTANCE = new CosemString();
29 private CosemString() {
32 public CosemString(String channelId) {
37 * Parses a String value to a {@link StringType}.
39 * @param cosemValue the value to parse
40 * @return {@link StringType} representing the value of the cosem value
43 protected StringType getStateValue(String cosemValue) {
44 return new StringType(cosemValue);