public final class MacUtils extends Object
MAC addresses
.Modifier and Type | Field and Description |
---|---|
protected static String |
COUNT_GE_ONE
Exception Message: count must be greater than 1
|
Modifier and Type | Method and Description |
---|---|
static List<MacAddress> |
getRandomMacs(MacRange range,
int count)
Returns a list of randomly generated MAC addresses.
|
static List<MacAddress> |
getRandomMacs(String spec,
int count)
Returns a list of randomly generated MAC addresses.
|
static MacAddress |
getRepeatedByteMacAddress(int seed)
Returns a MAC address where all the bytes are set to the
specified seed value.
|
protected static final String COUNT_GE_ONE
public static MacAddress getRepeatedByteMacAddress(int seed)
MacAddress mac = MacUtils.getRepeatedByteMacAddress(249);will return the MAC address
F9:F9:F9:F9:F9:F9
seed
- the seed valueIllegalArgumentException
- if seed is not in the range 0..255public static List<MacAddress> getRandomMacs(String spec, int count)
MacRange
for a definition of the range specification.
Note that addresses may be repeated in the list.spec
- a string defining the set of MAC addresses from which to
draw the random samplescount
- the number of MAC addresses to return in the listIllegalArgumentException
- if count is less than 1 or if the
spec is ill-formedNullPointerException
- if spec is nullpublic static List<MacAddress> getRandomMacs(MacRange range, int count)
range
- a MAC address range from which to draw the random samplescount
- the number of MAC addresses to return in the listIllegalArgumentException
- if count is less than 1Copyright © 2015. All Rights Reserved.