Class AbstractSRP6IntegerVariable

    • Constructor Detail

      • AbstractSRP6IntegerVariable

        public AbstractSRP6IntegerVariable()
    • Method Detail

      • equals

        public final boolean equals​(Object obj)
        Compares the specified object with this SRP-6 Integer Variable for equality.

        Returns true if and only if the specified object is also an SRP-6 Integer Variable and both SRP-6 Integer Variables map to the same byte sequence. The mapping provided by SRP6IntegerVariable.bytes(ByteOrder) must be used.

        Implementation Notes:
        This implementation first checks if the specified object is this SRP-6 Integer Variable. If so, it returns true; if not, it checks if the specified object is an SRP-6 Integer Variable. If not, it returns false; if so, it checks whether both SRP-6 Integer Variables map to the same byte sequence; if so, it returns true.

        Specified by:
        equals in interface SRP6IntegerVariable
        Overrides:
        equals in class Object
        Parameters:
        obj - the object to be compared for equality with this SRP-6 Integer Variable
        Returns:
        true if the specified object is equal to this SRP-6 Integer Variable
      • hashCode

        public int hashCode()
        Returns the hash code value for this SRP-6 Integer Variable.

        The hash code of an SRP-6 Integer Variable has to obey the general contract of Object.hashCode(). That is, if two SRP-6 Integer Variables are equal, then they must have the same hash code.

        Implementation Note:
        The hash code of an SRP-6 Integer Variable is defined as:

         this.bytes(ByteOrder.BIG_ENDIAN).hashCode();
         
        Specified by:
        hashCode in interface SRP6IntegerVariable
        Overrides:
        hashCode in class Object
        Returns:
        the hash code value for this SRP-6 Integer Variable