Record Class UsersRest.UserView
java.lang.Object
java.lang.Record
org.apache.juneau.petstore.console.users.UsersRest.UserView
- Record Components:
username- The username (primary key).firstName- The first name.lastName- The last name.userStatus- The account status.
- Enclosing class:
- UsersRest
public static record UsersRest.UserView(String username, String firstName, String lastName, UserStatus userStatus)
extends Record
A user as the console shows it: everything but the password.
Example:
{ username:'mwatson', firstName:'Mary', lastName:'Watson', userStatus:'ACTIVE' }
-
Constructor Summary
ConstructorsConstructorDescriptionUserView(String username, String firstName, String lastName, UserStatus userStatus) Creates an instance of aUserViewrecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.Returns the value of thefirstNamerecord component.final inthashCode()Returns a hash code value for this object.lastName()Returns the value of thelastNamerecord component.static UsersRest.UserViewfinal StringtoString()Returns a string representation of this record class.username()Returns the value of theusernamerecord component.Returns the value of theuserStatusrecord component.
-
Constructor Details
-
UserView
Creates an instance of aUserViewrecord class.- Parameters:
username- the value for theusernamerecord componentfirstName- the value for thefirstNamerecord componentlastName- the value for thelastNamerecord componentuserStatus- the value for theuserStatusrecord component
-
-
Method Details
-
of
- Parameters:
u- The stored user.- Returns:
- Its password-free view.
-
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
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). -
username
Returns the value of theusernamerecord component.- Returns:
- the value of the
usernamerecord component
-
firstName
Returns the value of thefirstNamerecord component.- Returns:
- the value of the
firstNamerecord component
-
lastName
Returns the value of thelastNamerecord component.- Returns:
- the value of the
lastNamerecord component
-
userStatus
Returns the value of theuserStatusrecord component.- Returns:
- the value of the
userStatusrecord component
-