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.mqtt.generic.mapping;
15 import static java.lang.annotation.ElementType.*;
17 import java.lang.annotation.Retention;
18 import java.lang.annotation.RetentionPolicy;
19 import java.lang.annotation.Target;
22 * Annotate an attribute class or class fields if the MQTT topic differs compared to the field name by a prefix.
23 * The default prefix if annotated without an argument is "$".
26 * Example: The MQTT topic is "my-example/$testname". The corresponding attribute class looks like this:
31 * class MyExample extends AbstractMqttAttributeClass {
36 * @author David Graeff - Initial contribution
38 @Retention(RetentionPolicy.RUNTIME)
39 @Target({ TYPE, FIELD })
40 public @interface TopicPrefix {
41 String value() default "$";