2 * Copyright (c) 2010-2024 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.serial.internal.transform;
15 import java.util.Optional;
17 import org.eclipse.jdt.annotation.NonNullByDefault;
20 * The {@link NoOpValueTransformation} implements a no-op (identity) transformation
22 * @author Jan N. Klug - Initial contribution
23 * @author Mike Major - Copied from HTTP binding to provide consistent user experience
26 public class NoOpValueTransformation implements ValueTransformation {
27 private static final NoOpValueTransformation NO_OP_VALUE_TRANSFORMATION = new NoOpValueTransformation();
30 public Optional<String> apply(final String value) {
31 return Optional.of(value);
35 * get the static value transformation for identity
39 public static ValueTransformation getInstance() {
40 return NO_OP_VALUE_TRANSFORMATION;