Class AbstractSRP6IntegerVariable
- java.lang.Object
-
- com.github.glusk.srp6_variables.AbstractSRP6IntegerVariable
-
- All Implemented Interfaces:
SRP6IntegerVariable
- Direct Known Subclasses:
SRP6ClientPublicKey,SRP6ClientSharedSecret,SRP6CustomIntegerVariable,SRP6Multiplier,SRP6PrivateKey,SRP6RandomEphemeral,SRP6ScramblingParameter,SRP6ServerPublicKey,SRP6ServerSharedSecret,SRP6Verifier
public abstract class AbstractSRP6IntegerVariable extends Object implements SRP6IntegerVariable
This class provides a skeletal implementation of theSRP6IntegerVariableinterface to minimize the effort required to implement this interface.Method
equals()andhashCode()are already implemented as per the specification inSRP6IntegerVariable.
-
-
Constructor Summary
Constructors Constructor Description AbstractSRP6IntegerVariable()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(Object obj)Compares the specified object with this SRP-6 Integer Variable for equality.inthashCode()Returns the hash code value for this SRP-6 Integer Variable.-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.github.glusk.srp6_variables.SRP6IntegerVariable
asNonNegativeBigInteger, bytes, bytes
-
-
-
-
Method Detail
-
equals
public final boolean equals(Object obj)
Compares the specified object with this SRP-6 Integer Variable for equality.Returns
trueif 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 bySRP6IntegerVariable.bytes(ByteOrder)must be used.Implementation Notes:
This implementation first checks if the specified object is this SRP-6 Integer Variable. If so, it returnstrue; if not, it checks if the specified object is an SRP-6 Integer Variable. If not, it returnsfalse; if so, it checks whether both SRP-6 Integer Variables map to the same byte sequence; if so, it returnstrue.- Specified by:
equalsin interfaceSRP6IntegerVariable- Overrides:
equalsin classObject- Parameters:
obj- the object to be compared for equality with this SRP-6 Integer Variable- Returns:
trueif 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:
hashCodein interfaceSRP6IntegerVariable- Overrides:
hashCodein classObject- Returns:
- the hash code value for this SRP-6 Integer Variable
-
-