Class MachineId

java.lang.Object
me.ahoo.cosid.machine.MachineId

@Immutable public class MachineId extends Object
Logical machine identifier for distributed ID generation.

This represents a logical machine ID that is not necessarily tied to a physical or virtual machine. It provides uniqueness across different processes/services which are isolated using namespaces.

See Also:
  • Constructor Details

    • MachineId

      public MachineId(int machineId)
      Creates a new MachineId.
      Parameters:
      machineId - the machine ID value
  • Method Details

    • getMachineId

      public int getMachineId()
      Gets the machine ID value.
      Returns:
      the machine ID
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object