Class MACAddress

java.lang.Object
de.powerstat.validation.values.MACAddress
All Implemented Interfaces:
IValueObject, Comparable<MACAddress>

public final class MACAddress extends Object implements Comparable<MACAddress>, IValueObject
Canonical Media-Access-Control-Adresse (MAC). TODO getManufacturer name TODO Exists in network http://standards-oui.ieee.org/oui/oui.csv
  • Field Details

  • Constructor Details

  • Method Details

    • of

      public static MACAddress of(String address)
      MACAddress factory.
      Parameters:
      address - MAC address
      Returns:
      MACAddress object
    • stringValue

      public String stringValue(String delimiter)
      Returns the value of this MACAddress as a string.
      Parameters:
      delimiter - Delimiter could be empty, : or -
      Returns:
      The text value represented by this object after conversion to type string.
    • stringValue

      public String stringValue()
      Returns the value of this MACADdress as a string with delimiter ':'.
      Specified by:
      stringValue in interface IValueObject
      Returns:
      The text value represented by this object after conversion to type string.
    • isBroadcast

      public boolean isBroadcast()
      Is broadcast address.
      Returns:
      true if broadcast address, false otherwise
    • isGroup

      public boolean isGroup()
      Is group.
      Returns:
      true: group, false: individual
    • isLocal

      public boolean isLocal()
      Is local.
      Returns:
      true: local, false: universal
    • isIPV4Multicast

      public boolean isIPV4Multicast()
      Is IP v4 multicast mac.
      Returns:
      true if mac is an ip v4 multicast address, false otherwise
    • isIPV6Multicast

      public boolean isIPV6Multicast()
      Is IP v6 multicast mac.
      Returns:
      true if mac is an ip v6 multicast address, false otherwise
    • isVRRP

      public boolean isVRRP()
      Is VRRP mac (Virtual Router Redundancy Protocol).
      Returns:
      true if mac is a vrrp address, false otherwise
    • getOUI

      public String getOUI()
      Get OUI (Organizationally Unique Identifier).
      Returns:
      OUI (MA-L) string 000000 TODO OUI-28 (MA-M), OUI-36 (MA-S)
    • hashCode

      public int hashCode()
      Calculate hash code.
      Overrides:
      hashCode in class Object
      Returns:
      Hash
      See Also:
    • equals

      public boolean equals(Object obj)
      Is equal with another object.
      Overrides:
      equals in class Object
      Parameters:
      obj - Object
      Returns:
      true when equal, false otherwise
      See Also:
    • toString

      public String toString()
      Returns the string representation of this MACAddress. The exact details of this representation are unspecified and subject to change, but the following may be regarded as typical: "MACAddress[address=00:00:00:00:00:00]"
      Overrides:
      toString in class Object
      Returns:
      String representation of this MACAddress
      See Also:
    • compareTo

      public int compareTo(MACAddress obj)
      Compare with another object.
      Specified by:
      compareTo in interface Comparable<MACAddress>
      Parameters:
      obj - Object to compare with
      Returns:
      0: equal; 1: greater; -1: smaller
      See Also: