]> git.basschouten.com Git - openhab-addons.git/blob
21f1432e6e174d2b520cbd7df91bae3615b37125
[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  * BEGIN:<item_name>:<new_state>
22  * END:<item_name>:<new_state>
23  *
24  * @author Andrew Fiddian-Green - Initial contribution
25  */
26 @NonNullByDefault
27 public enum CommandTagType {
28     BEGIN,
29     END;
30
31     public static boolean prefixValid(@Nullable String line) {
32         return (line != null) && (line.startsWith(BEGIN.toString()) || line.startsWith(END.toString()));
33     }
34 }