Formatting

This commit is contained in:
Mattias Holmqvist 2011-11-23 07:33:56 +01:00
parent 1d5472d082
commit 0d6fd403bc
1 changed files with 17 additions and 18 deletions

View File

@ -31,25 +31,24 @@ import com.google.common.collect.Iterables;
*/
public enum MacAddressToBSD implements Function<String, String> {
INSTANCE;
INSTANCE;
@Override
public String apply(String macAddress) {
checkArgument(macAddress.length() == 17);
return Joiner.on(":").join(
Iterables.transform(Splitter.on(":").split(macAddress),
new Function<String, String>() {
@Override
public String apply(String arg0) {
if (arg0.equals("00"))
return "0";
if (arg0.startsWith("0"))
return arg0.substring(1);
@Override
public String apply(String macAddress) {
checkArgument(macAddress.length() == 17);
return Joiner.on(":").join(
Iterables.transform(Splitter.on(":").split(macAddress),
new Function<String, String>() {
@Override
public String apply(String arg0) {
if (arg0.equals("00"))
return "0";
if (arg0.startsWith("0"))
return arg0.substring(1);
return arg0;
}
}));
}
return arg0;
}
}));
}
}