Record Class Document
java.lang.Object
java.lang.Record
com.irurueta.authserver.serviceclient.domain.documents.Document
- Record Components:
id- unique identifier of the document.owner- subject of the user who owns the document.title- short title of the document.
A document owned by a user, as the resource server lists it.
-
Field Summary
Fields -
Constructor Summary
Constructors -
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.id()Returns the value of theidrecord component.owner()Returns the value of theownerrecord component.private static voidrequireText(String value, String name) Rejects a null or blank value.title()Returns the value of thetitlerecord component.final StringtoString()Returns a string representation of this record class.
-
Field Details
-
Constructor Details
-
Document
Validates the invariants of a document.- Throws:
IllegalArgumentException- if the id, owner or title is null or blank.
-
-
Method Details
-
requireText
Rejects a null or blank value.- Parameters:
value- value to check.name- name of the component, used in the message.- Throws:
IllegalArgumentException- if the value is null or blank.
-
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. -
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). -
id
Returns the value of theidrecord component.- Returns:
- the value of the
idrecord component
-
owner
Returns the value of theownerrecord component.- Returns:
- the value of the
ownerrecord component
-
title
Returns the value of thetitlerecord component.- Returns:
- the value of the
titlerecord component
-