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 ValueTransformation} applies a set of transformations to a value
22 * @author Jan N. Klug - Initial contribution
23 * @author Mike Major - Copied from HTTP binding to provide consistent user experience
26 public interface ValueTransformation {
29 * applies the value transformation to a value
31 * @param value The value
32 * @return Optional of string representing the transformed value (empty if transformation not present or failed)
34 Optional<String> apply(String value);