Class MacAddress

java.lang.Object
overit.geocall.util.MacAddress

public class MacAddress extends Object
The class implements the MAC Address (Media Access Control Address), that is the unique identifier assigned to a network interface controller for communications at the data link layer of a network segment
  • Constructor Summary

    Constructors
    Constructor
    Description
    MacAddress(byte[] bb)
    Creates a new instance of MacAddress starting from the byte array passed as parameter
    Creates a new instance of MacAddress starting from the string passed as parameter
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
     
    byte[]
    Returns the byte array that defines the MacAddress
    int
     
    Returns a code string representation of the MacAddress without delimiters
     

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • MacAddress

      public MacAddress(byte[] bb)
      Creates a new instance of MacAddress starting from the byte array passed as parameter
      Parameters:
      bb - The byte array used to create the MacAddress
    • MacAddress

      public MacAddress(String mac)
      Creates a new instance of MacAddress starting from the string passed as parameter
      Parameters:
      mac - The string used to create the MacAddress
  • Method Details

    • toString

      public String toString()
      Overrides:
      toString in class Object
    • toCode

      public String toCode()
      Returns a code string representation of the MacAddress without delimiters
      Returns:
      A string representation of the MacAddress without delimiters
    • getBytes

      public byte[] getBytes()
      Returns the byte array that defines the MacAddress
      Returns:
      The byte array that defines the MacAddress
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object