| 1 | package edu.ucsb.cs156.dining.entities; | |
| 2 | ||
| 3 | import jakarta.persistence.Entity; | |
| 4 | import jakarta.persistence.GeneratedValue; | |
| 5 | import jakarta.persistence.GenerationType; | |
| 6 | import jakarta.persistence.Id; | |
| 7 | import lombok.AccessLevel; | |
| 8 | import lombok.AllArgsConstructor; | |
| 9 | import lombok.Builder; | |
| 10 | import lombok.Data; | |
| 11 | import lombok.NoArgsConstructor; | |
| 12 | ||
| 13 | import java.time.LocalDate; | |
| 14 | ||
| 15 | /** | |
| 16 | * This is a JPA entity that represents a user. | |
| 17 | */ | |
| 18 | ||
| 19 | @Data | |
| 20 | @AllArgsConstructor | |
| 21 | @NoArgsConstructor(access = AccessLevel.PROTECTED) | |
| 22 | @Builder | |
| 23 | @Entity(name = "users") | |
| 24 | public class User { | |
| 25 | @Id | |
| 26 | @GeneratedValue(strategy = GenerationType.IDENTITY) | |
| 27 | private long id; | |
| 28 | private String email; | |
| 29 | private String googleSub; | |
| 30 | private String pictureUrl; | |
| 31 | private String fullName; | |
| 32 | private String givenName; | |
| 33 | private String familyName; | |
| 34 | private boolean emailVerified; | |
| 35 | private String locale; | |
| 36 | private String hostedDomain; | |
| 37 | private boolean admin; | |
| 38 | private String alias; | |
| 39 | private String proposedAlias; | |
| 40 | private String status; | |
| 41 | private LocalDate dateApproved; | |
| 42 | | |
| 43 | public String getAlias() { | |
| 44 |
1
1. getAlias : negated conditional → KILLED |
if (this.alias == null) { |
| 45 | this.alias = "Anonymous User"; | |
| 46 | } | |
| 47 |
1
1. getAlias : replaced return value with "" for edu/ucsb/cs156/dining/entities/User::getAlias → KILLED |
return this.alias; |
| 48 | } | |
| 49 | } | |
Mutations | ||
| 44 |
1.1 |
|
| 47 |
1.1 |