Class BigIdLong

java.lang.Object
org.sensorhub.api.common.BigIdLong
All Implemented Interfaces:
Comparable<BigId>, BigId

public class BigIdLong extends Object implements BigId

BigId implementation backed by a single long value

Since:
Apr 14, 2022
  • Field Details

    • scope

      protected int scope
    • id

      protected long id
  • Constructor Details

    • BigIdLong

      public BigIdLong(int scope, long id)
  • Method Details

    • getScope

      public int getScope()
      Specified by:
      getScope in interface BigId
      Returns:
      The scope within which the ID is valid
    • getIdAsBytes

      public byte[] getIdAsBytes()
      Specified by:
      getIdAsBytes in interface BigId
      Returns:
      The value of the ID part as a byte array
    • getIdAsLong

      public long getIdAsLong()
      Specified by:
      getIdAsLong in interface BigId
      Returns:
      The value of the ID part as a long
    • size

      public int size()
      Specified by:
      size in interface BigId
      Returns:
      Size of the ID part in bytes
    • equals

      public boolean equals(Object obj)
      Specified by:
      equals in interface BigId
      Overrides:
      equals in class Object
    • compareTo

      public int compareTo(BigId other)
      Specified by:
      compareTo in interface BigId
      Specified by:
      compareTo in interface Comparable<BigId>
    • hashCode

      public int hashCode()
      Specified by:
      hashCode in interface BigId
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object