2 * Copyright (c) 2010-2024 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.mikrotik.internal.model;
15 import org.eclipse.jdt.annotation.NonNullByDefault;
16 import org.eclipse.jdt.annotation.Nullable;
19 * The {@link RouterosInterfaceType} enum wraps RouterOS network interface type strings.
21 * @author Oleg Vivtash - Initial contribution
25 public enum RouterosInterfaceType {
30 PPP_CLIENT("ppp-out"),
31 PPPOE_CLIENT("pppoe-out"),
32 L2TP_SERVER("l2tp-in"),
33 L2TP_CLIENT("l2tp-out"),
36 private final String typeName;
38 RouterosInterfaceType(String routerosType) {
39 this.typeName = routerosType;
42 public boolean equalsName(String otherType) {
43 // (otherName == null) check is not needed because name.equals(null) returns false
44 return typeName.equals(otherType);
48 public String toString() {
52 public @Nullable static RouterosInterfaceType resolve(@Nullable String routerosType) {
53 for (RouterosInterfaceType current : RouterosInterfaceType.values()) {
54 if (current.typeName.equals(routerosType)) {