001/* 002 * Licensed to the Apache Software Foundation (ASF) under one or more 003 * contributor license agreements. See the NOTICE file distributed with 004 * this work for additional information regarding copyright ownership. 005 * The ASF licenses this file to You under the Apache License, Version 2.0 006 * (the "License"); you may not use this file except in compliance with 007 * the License. You may obtain a copy of the License at 008 * 009 * http://www.apache.org/licenses/LICENSE-2.0 010 * 011 * Unless required by applicable law or agreed to in writing, software 012 * distributed under the License is distributed on an "AS IS" BASIS, 013 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 014 * See the License for the specific language governing permissions and 015 * limitations under the License. 016 */ 017package org.apache.juneau.petstore.dto; 018 019import org.apache.juneau.commons.bean.*; 020 021/** 022 * User domain bean. 023 * 024 * <p> 025 * Represents a registered petstore user. The {@code username} is the primary key. 026 * 027 * <h5 class='section'>See Also:</h5><ul> 028 * <li class='link'><a class="doclink" href="https://juneau.apache.org/docs/topics/JuneauPetstore">juneau-petstore</a> 029 * </ul> 030 */ 031public class User { 032 033 private String username; 034 private String firstName; 035 private String lastName; 036 private String email; 037 private String password; 038 private String phone; 039 private UserStatus userStatus; 040 041 /** 042 * Returns the username (primary key). 043 * 044 * @return The username. 045 */ 046 public String getUsername() { 047 return username; 048 } 049 050 /** 051 * Sets the username. 052 * 053 * @param value The new value. 054 * @return This object. 055 */ 056 public User setUsername(String value) { 057 username = value; 058 return this; 059 } 060 061 /** 062 * Returns the first name. 063 * 064 * @return The first name. Can be <jk>null</jk> if not set. 065 */ 066 public String getFirstName() { 067 return firstName; 068 } 069 070 /** 071 * Sets the first name. 072 * 073 * @param value The new value. Can be <jk>null</jk> to unset the property. 074 * @return This object. 075 */ 076 public User setFirstName(String value) { 077 firstName = value; 078 return this; 079 } 080 081 /** 082 * Returns the last name. 083 * 084 * @return The last name. Can be <jk>null</jk> if not set. 085 */ 086 public String getLastName() { 087 return lastName; 088 } 089 090 /** 091 * Sets the last name. 092 * 093 * @param value The new value. Can be <jk>null</jk> to unset the property. 094 * @return This object. 095 */ 096 public User setLastName(String value) { 097 lastName = value; 098 return this; 099 } 100 101 /** 102 * Returns the email address. 103 * 104 * @return The email address. Can be <jk>null</jk> if not set. 105 */ 106 public String getEmail() { 107 return email; 108 } 109 110 /** 111 * Sets the email address. 112 * 113 * @param value The new value. Can be <jk>null</jk> to unset the property. 114 * @return This object. 115 */ 116 public User setEmail(String value) { 117 email = value; 118 return this; 119 } 120 121 /** 122 * Returns the password. 123 * 124 * <p> 125 * Stored in plaintext for sample purposes only. Do not use this pattern in production. 126 * 127 * <p> 128 * Write-only: the password is accepted on create and update but is never serialized, so no response carries it. 129 * 130 * @return The password. Can be <jk>null</jk> if not set. 131 */ 132 @BeanProp(wo="true") 133 public String getPassword() { 134 return password; 135 } 136 137 /** 138 * Sets the password. 139 * 140 * @param value The new value. Can be <jk>null</jk> to unset the property. 141 * @return This object. 142 */ 143 public User setPassword(String value) { 144 password = value; 145 return this; 146 } 147 148 /** 149 * Returns the phone number. 150 * 151 * @return The phone number. Can be <jk>null</jk> if not set. 152 */ 153 public String getPhone() { 154 return phone; 155 } 156 157 /** 158 * Sets the phone number. 159 * 160 * @param value The new value. Can be <jk>null</jk> to unset the property. 161 * @return This object. 162 */ 163 public User setPhone(String value) { 164 phone = value; 165 return this; 166 } 167 168 /** 169 * Returns the user account status. 170 * 171 * @return The user account status. 172 */ 173 public UserStatus getUserStatus() { 174 return userStatus; 175 } 176 177 /** 178 * Sets the user account status. 179 * 180 * @param value The new value. 181 * @return This object. 182 */ 183 public User setUserStatus(UserStatus value) { 184 userStatus = value; 185 return this; 186 } 187}