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.onewire.internal.owserver;
15 import org.eclipse.jdt.annotation.NonNullByDefault;
18 * The {@link OwserverMessageType} provides the owserver protocol message type
20 * @author Jan N. Klug - Initial contribution
24 public enum OwserverMessageType {
34 DIRALLSLASH(0x00000009),
37 private final int messageType;
39 OwserverMessageType(int messageType) {
40 this.messageType = messageType;
44 * get the this message type's numeric representation
46 * @return integer value of this message type
48 public int getValue() {
53 * return a new OwMessageType from an integer
55 * @param messageType the message type as integer
56 * @return OwMessageType
58 public static OwserverMessageType fromInt(int messageType) throws IllegalArgumentException {
59 for (OwserverMessageType value : values()) {
60 if (value.getValue() == messageType) {
64 throw new IllegalArgumentException();