3 * Copyright (c) 2013 Cisco Systems, Inc. and others. All rights reserved.
5 * This program and the accompanying materials are made available under the
6 * terms of the Eclipse Public License v1.0 which accompanies this distribution,
7 * and is available at http://www.eclipse.org/legal/epl-v10.html
10 package org.opendaylight.controller.sal.utils;
12 import java.util.ArrayList;
13 import java.util.List;
15 public final class TierHelper {
16 private static TierHelper tierHelper;
17 public static final int unknownTierNumber = 0;
18 private List<String> tierNames;
21 tierHelper = new TierHelper();
24 private TierHelper() {
25 tierNames = new ArrayList<String>();
26 tierNames.add("Unknown");
27 tierNames.add("Access");
28 tierNames.add("Distribution");
29 tierNames.add("Core");
32 public static void setTierName(int tier, String name) {
33 if (tier > tierHelper.tierNames.size() - 1) {
34 for (int i = tierHelper.tierNames.size() - 1; i < tier; i++) {
35 tierHelper.tierNames.add("Unknown");
38 tierHelper.tierNames.set(tier, name);
41 public static String getTierName(int tier) {
42 if ((tier < 0) || (tier > tierHelper.tierNames.size() - 1)) {
45 return tierHelper.tierNames.get(tier);
48 public static List<String> getTiers() {
49 return tierHelper.tierNames;