2 * Copyright (c) 2010-2021 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 PPPOE_CLIENT("pppoe-out"),
31 L2TP_SERVER("l2tp-in"),
32 L2TP_CLIENT("l2tp-out");
34 private final String typeName;
36 RouterosInterfaceType(String routerosType) {
37 this.typeName = routerosType;
40 public boolean equalsName(String otherType) {
41 // (otherName == null) check is not needed because name.equals(null) returns false
42 return typeName.equals(otherType);
45 public String toString() {
49 public @Nullable static RouterosInterfaceType resolve(@Nullable String routerosType) {
50 for (RouterosInterfaceType current : RouterosInterfaceType.values()) {
51 if (current.typeName.equals(routerosType)) {