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 OwserverControlFlag} provides the owserver protocol control flag
20 * @author Jan N. Klug - Initial contribution
24 public enum OwserverControlFlag {
28 PERSISTENCE(0x00000004),
30 DEVICE_DISPLAY(0x00000000),
33 private final int controlFlag;
35 OwserverControlFlag(int controlFlag) {
36 this.controlFlag = controlFlag;
40 * get the this flag's numeric representation
42 * @return integer value of this flag
44 public int getValue() {
49 * check if a this flag is set in the parameter
51 * @param controlFlags full control flag
52 * @return true if this flag is set in the parameter
54 public boolean isSet(int controlFlags) {
55 return (this.getValue() & controlFlags) == this.getValue();