blob: 1c0fdbc887042af06fb2f90df512f83b28415cbe [file] [log] [blame]
Daniele Moro94660a02019-12-02 12:02:07 -08001/*
Joey Armstronga68e7852024-01-28 13:27:02 -05002 * Copyright 2019-2024 Open Networking Foundation (ONF) and the ONF Contributors
Daniele Moro94660a02019-12-02 12:02:07 -08003 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17package org.opencord.bng.cli;
18
19import org.onosproject.net.behaviour.BngProgrammable.BngCounterType;
20
21/**
22 * Utilities to print counter names in CLI output.
23 */
24public final class BngCliUtils {
25
26 private BngCliUtils() {
27 }
28
29 /**
30 * Prints a nicer counter name on CLI output.
31 *
32 * @param counterName The counter type to be converted
33 * @return The string representing the counter
34 */
35 static String niceCounterName(BngCounterType counterName) {
36 switch (counterName) {
37 case CONTROL_PLANE:
38 return "Upstream Control";
39 case DOWNSTREAM_RX:
40 return "Downstream Received";
41 case DOWNSTREAM_TX:
42 return "Downstream Transmitted";
43 case UPSTREAM_DROPPED:
44 return "Upstream Dropped";
45 case UPSTREAM_TX:
46 return "Upstream Terminated";
47 default:
48 return "UNKNOWN";
49 }
50 }
51}