Record Class CalibrationProfile

java.lang.Object
java.lang.Record
com.svenruppert.jsentinel.credential.password.calibration.CalibrationProfile
Record Components:
algorithm - canonical algorithm identifier
providerId - provider that produced the profile
parameters - calibrated parameter map (defensive copy, unmodifiable)
targetMillis - the runtime the operator asked for
measuredMillis - the runtime actually achieved with parameters during calibration
calibratedAt - instant the calibration finished

public record CalibrationProfile(String algorithm, String providerId, Map<String,String> parameters, long targetMillis, long measuredMillis, Instant calibratedAt) extends Record
Reproducible calibration result for a single password-hash algorithm.

Operators run the calibrator once for a target verification time (typically 200–500 ms) and persist the resulting profile. At startup the policy loads the profile and uses its parameters; the system never calibrates silently on every startup (a quiet recalibration would defeat reproducibility and make rehash decisions non-deterministic, CWE-754).

  • Constructor Details

    • CalibrationProfile

      public CalibrationProfile(String algorithm, String providerId, Map<String,String> parameters, long targetMillis, long measuredMillis, Instant calibratedAt)
      Creates an instance of a CalibrationProfile record class.
      Parameters:
      algorithm - the value for the algorithm record component
      providerId - the value for the providerId record component
      parameters - the value for the parameters record component
      targetMillis - the value for the targetMillis record component
      measuredMillis - the value for the measuredMillis record component
      calibratedAt - the value for the calibratedAt record component
  • Method Details

    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • 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.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      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. Reference components are compared with Objects::equals(Object,Object); primitive components are compared with the compare method from their corresponding wrapper classes.
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • algorithm

      public String algorithm()
      Returns the value of the algorithm record component.
      Returns:
      the value of the algorithm record component
    • providerId

      public String providerId()
      Returns the value of the providerId record component.
      Returns:
      the value of the providerId record component
    • parameters

      public Map<String,String> parameters()
      Returns the value of the parameters record component.
      Returns:
      the value of the parameters record component
    • targetMillis

      public long targetMillis()
      Returns the value of the targetMillis record component.
      Returns:
      the value of the targetMillis record component
    • measuredMillis

      public long measuredMillis()
      Returns the value of the measuredMillis record component.
      Returns:
      the value of the measuredMillis record component
    • calibratedAt

      public Instant calibratedAt()
      Returns the value of the calibratedAt record component.
      Returns:
      the value of the calibratedAt record component