Http client for testing restconf
[controller.git] / opendaylight / netconf / netconf-testtool / src / main / java / org / opendaylight / controller / netconf / test / tool / TestToolUtils.java
1 /*
2  * Copyright (c) 2015 Cisco Systems, Inc. and others.  All rights reserved.
3  *
4  * This program and the accompanying materials are made available under the
5  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6  * and is available at http://www.eclipse.org/legal/epl-v10.html
7  */
8
9 package org.opendaylight.controller.netconf.test.tool;
10
11 public class TestToolUtils {
12
13     public static String getMac(long mac) {
14         StringBuilder m = new StringBuilder(Long.toString(mac, 16));
15
16         for (int i = m.length(); i < 12; i++) {
17             m.insert(0, "0");
18         }
19
20         for (int j = m.length() - 2; j >= 2; j -= 2) {
21             m.insert(j, ":");
22         }
23
24         return m.toString();
25     }
26 }