]> git.basschouten.com Git - openhab-addons.git/blob
b30ab1ddc63b8ac59957802261db51777d11f788
[openhab-addons.git] /
1 /**
2  * Copyright (c) 2010-2024 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.serial.internal.transform;
14
15 import java.util.Optional;
16
17 import org.eclipse.jdt.annotation.NonNullByDefault;
18
19 /**
20  * The {@link ValueTransformation} applies a set of transformations to a value
21  *
22  * @author Jan N. Klug - Initial contribution
23  * @author Mike Major - Copied from HTTP binding to provide consistent user experience
24  */
25 @NonNullByDefault
26 public interface ValueTransformation {
27
28     /**
29      * applies the value transformation to a value
30      *
31      * @param value The value
32      * @return Optional of string representing the transformed value (empty if transformation not present or failed)
33      */
34     Optional<String> apply(String value);
35 }