]> git.basschouten.com Git - openhab-addons.git/blob
aef55cf71037f27d0bcc7128ba4fb35e93b715fe
[openhab-addons.git] /
1 /**
2  * Copyright (c) 2010-2023 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.icalendar.internal.logic;
14
15 import org.eclipse.jdt.annotation.NonNullByDefault;
16 import org.eclipse.jdt.annotation.Nullable;
17
18 /**
19  * A type enumerator to indicate whether a Command Tag is of type BEGIN or END; as in the following examples:
20  *
21  * <pre>
22  * {@code
23  * BEGIN:<item_name>:<new_state>
24  * END:<item_name>:<new_state>
25  * }
26  * </pre>
27  *
28  * @author Andrew Fiddian-Green - Initial contribution
29  */
30 @NonNullByDefault
31 public enum CommandTagType {
32     BEGIN,
33     END;
34
35     public static boolean prefixValid(@Nullable String line) {
36         return (line != null) && (line.startsWith(BEGIN.toString()) || line.startsWith(END.toString()));
37     }
38 }