Package co.cryptoservice.sdk
Record Class PasswordHashRequest
java.lang.Object
java.lang.Record
co.cryptoservice.sdk.PasswordHashRequest
- Record Components:
password- the passwordtimeCost- the Argon2id passes, or null for the defaultmemoryCost- the Argon2id memory in KiB, or null for the defaultparallelism- the Argon2id lanes, or null for the default
public record PasswordHashRequest(String password, Integer timeCost, Integer memoryCost, Integer parallelism)
extends Record
The body of
POST /v2/password/hash.-
Constructor Summary
ConstructorsConstructorDescriptionPasswordHashRequest(String password, Integer timeCost, Integer memoryCost, Integer parallelism) Checks that every required member is present. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.Returns the value of thememoryCostrecord component.static PasswordHashRequestA request with only the required members; the optional ones are null.Returns the value of theparallelismrecord component.password()Returns the value of thepasswordrecord component.timeCost()Returns the value of thetimeCostrecord component.toString()Names the members; values that may be secret (keys, plaintexts, passwords, signatures) are redacted.withMemoryCost(Integer memoryCost) A copy withmemoryCostreplaced.withParallelism(Integer parallelism) A copy withparallelismreplaced.withTimeCost(Integer timeCost) A copy withtimeCostreplaced.
-
Constructor Details
-
PasswordHashRequest
public PasswordHashRequest(String password, Integer timeCost, Integer memoryCost, Integer parallelism) Checks that every required member is present.- Throws:
NullPointerException- when a required member is null
-
-
Method Details
-
of
A request with only the required members; the optional ones are null.- Parameters:
password- the password- Returns:
- the request
-
withTimeCost
A copy withtimeCostreplaced.- Parameters:
timeCost- the Argon2id passes, or null for the default- Returns:
- the new request
-
withMemoryCost
A copy withmemoryCostreplaced.- Parameters:
memoryCost- the Argon2id memory in KiB, or null for the default- Returns:
- the new request
-
withParallelism
A copy withparallelismreplaced.- Parameters:
parallelism- the Argon2id lanes, or null for the default- Returns:
- the new request
-
toString
Names the members; values that may be secret (keys, plaintexts, passwords, signatures) are redacted. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared withObjects::equals(Object,Object). -
password
Returns the value of thepasswordrecord component.- Returns:
- the value of the
passwordrecord component
-
timeCost
Returns the value of thetimeCostrecord component.- Returns:
- the value of the
timeCostrecord component
-
memoryCost
Returns the value of thememoryCostrecord component.- Returns:
- the value of the
memoryCostrecord component
-
parallelism
Returns the value of theparallelismrecord component.- Returns:
- the value of the
parallelismrecord component
-