Record Class ApiKeyService.IssuedCourseApiKey
java.lang.Object
java.lang.Record
edu.ucsb.cs156.frontiers.services.ApiKeyService.IssuedCourseApiKey
- Enclosing class:
ApiKeyService
public static record ApiKeyService.IssuedCourseApiKey(String key, Long courseId, ZonedDateTime issuedAt, ZonedDateTime expiresAt, String label)
extends Record
A freshly created key. This is the only time the key itself is available; only its hash is
stored.
-
Constructor Summary
ConstructorsConstructorDescriptionIssuedCourseApiKey(String key, Long courseId, ZonedDateTime issuedAt, ZonedDateTime expiresAt, String label) Creates an instance of aIssuedCourseApiKeyrecord class. -
Method Summary
Modifier and TypeMethodDescriptioncourseId()Returns the value of thecourseIdrecord component.final booleanIndicates whether some other object is "equal to" this one.Returns the value of theexpiresAtrecord component.final inthashCode()Returns a hash code value for this object.issuedAt()Returns the value of theissuedAtrecord component.key()Returns the value of thekeyrecord component.label()Returns the value of thelabelrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
IssuedCourseApiKey
public IssuedCourseApiKey(String key, Long courseId, ZonedDateTime issuedAt, ZonedDateTime expiresAt, String label) Creates an instance of aIssuedCourseApiKeyrecord class.- Parameters:
key- the value for thekeyrecord componentcourseId- the value for thecourseIdrecord componentissuedAt- the value for theissuedAtrecord componentexpiresAt- the value for theexpiresAtrecord componentlabel- the value for thelabelrecord component
-
-
Method Details
-
toString
-
hashCode
-
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). -
key
Returns the value of thekeyrecord component.- Returns:
- the value of the
keyrecord component
-
courseId
Returns the value of thecourseIdrecord component.- Returns:
- the value of the
courseIdrecord component
-
issuedAt
Returns the value of theissuedAtrecord component.- Returns:
- the value of the
issuedAtrecord component
-
expiresAt
Returns the value of theexpiresAtrecord component.- Returns:
- the value of the
expiresAtrecord component
-
label
Returns the value of thelabelrecord component.- Returns:
- the value of the
labelrecord component
-