• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

openmrs / openmrs-core / 41717837886

03 Nov 2026 08:59PM UTC coverage: 68.971% (+0.05%) from 68.922%
41717837886

push

github

ibacher
TRUNK-6863: Remove the generation token before clearing a node's cache locally (#6791)

1 of 1 new or added line in 1 file covered. (100.0%)

413 existing lines in 30 files now uncovered.

26445 of 38342 relevant lines covered (68.97%)

0.69 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

82.95
/api/src/main/java/org/openmrs/User.java
1
/**
2
 * This Source Code Form is subject to the terms of the Mozilla Public License,
3
 * v. 2.0. If a copy of the MPL was not distributed with this file, You can
4
 * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under
5
 * the terms of the Healthcare Disclaimer located at http://openmrs.org/license.
6
 *
7
 * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS
8
 * graphic logo is a trademark of OpenMRS Inc.
9
 */
10
package org.openmrs;
11

12
import javax.persistence.Cacheable;
13
import javax.persistence.CollectionTable;
14
import javax.persistence.Column;
15
import javax.persistence.ElementCollection;
16
import javax.persistence.Entity;
17
import javax.persistence.GeneratedValue;
18
import javax.persistence.GenerationType;
19
import javax.persistence.Id;
20
import javax.persistence.JoinColumn;
21
import javax.persistence.JoinTable;
22
import javax.persistence.ManyToMany;
23
import javax.persistence.ManyToOne;
24
import javax.persistence.MapKeyColumn;
25
import javax.persistence.Table;
26
import javax.persistence.Transient;
27
import java.util.ArrayList;
28
import java.util.Collection;
29
import java.util.Collections;
30
import java.util.Date;
31
import java.util.HashMap;
32
import java.util.HashSet;
33
import java.util.List;
34
import java.util.Locale;
35
import java.util.Map;
36
import java.util.Set;
37

38
import org.apache.commons.lang3.StringUtils;
39
import org.hibernate.annotations.Cache;
40
import org.hibernate.annotations.CacheConcurrencyStrategy;
41
import org.hibernate.annotations.Cascade;
42
import org.hibernate.annotations.CascadeType;
43
import org.hibernate.annotations.GenericGenerator;
44
import org.hibernate.annotations.LazyCollection;
45
import org.hibernate.annotations.LazyCollectionOption;
46
import org.hibernate.annotations.Parameter;
47
import org.hibernate.envers.Audited;
48
import org.hibernate.envers.NotAudited;
49
import org.openmrs.api.context.Context;
50
import org.openmrs.util.CollectionUtil;
51
import org.openmrs.util.LocaleUtility;
52
import org.openmrs.util.OpenmrsConstants;
53
import org.openmrs.util.OpenmrsUtil;
54
import org.openmrs.util.RoleConstants;
55
import org.slf4j.Logger;
56
import org.slf4j.LoggerFactory;
57

58
/**
59
 * Defines a User Account in the system. This account belongs to a {@link Person} in the system,
60
 * although that person may have other user accounts. Users have login credentials
61
 * (username/password) and can have special user properties. User properties are just simple
62
 * key-value pairs for either quick info or display specific info that needs to be persisted (like
63
 * locale preferences, search options, etc)
64
 */
65

66
@Entity
67
@Table(name = "users")
68
@Cacheable
69
@Cache(usage = CacheConcurrencyStrategy.READ_WRITE)
70
@Audited
71
public class User extends BaseOpenmrsObject implements java.io.Serializable, Attributable<User>, Auditable, Retireable {
72
        
73
        public static final long serialVersionUID = 2L ;
74
        
75
        private static final Logger log = LoggerFactory.getLogger(User.class);
1 ✔
76
        
77
        // Fields
78
        @Id
79
        @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "users_user_id_seq")
80
        @GenericGenerator(
81
                name = "users_user_id_seq",
82
                strategy = "native",
83
                parameters = @Parameter(name = "sequence", value = "users_user_id_seq")
84
        )
85
        @Column(name = "user_id")
86
        private Integer userId;
87

88
        @ManyToOne
89
        @JoinColumn(name = "person_id", nullable = false)
90
        @LazyCollection(LazyCollectionOption.FALSE)
91
        @Cascade(CascadeType.SAVE_UPDATE)
92
        private Person person;
93

94
        @Column(name = "system_id", nullable = false, length = 50)
95
        private String systemId;
96

97
        @Column(name = "username", length = 50)
98
        private String username;
99

100
        @Column(name = "email", length = 255, unique = true)
101
        private String email;
102

103
        @ManyToMany
104
        @JoinTable(name = "user_role", joinColumns = @JoinColumn(name = "user_id"), inverseJoinColumns = @JoinColumn(name = "role"))
105
        @LazyCollection(LazyCollectionOption.FALSE)
106
        @Cache(usage = CacheConcurrencyStrategy.READ_WRITE)
107
        @Cascade({ CascadeType.SAVE_UPDATE, CascadeType.MERGE, CascadeType.EVICT })
108
        private Set<Role> roles;
109

110
        @ElementCollection
111
        @CollectionTable(name = "user_property", joinColumns = @JoinColumn(name = "user_id", nullable = false))
112
        @MapKeyColumn(name = "property", length = 255)
113
        @Column(name = "property_value", length = Integer.MAX_VALUE)
114
        @Cascade({ CascadeType.SAVE_UPDATE, CascadeType.MERGE, CascadeType.EVICT })
115
        @NotAudited
116
        private Map<String, String> userProperties;
117

118
        @Transient
1 ✔
119
        private List<Locale> proficientLocales = null;
120

121
        @Transient
1 ✔
122
        private String parsedProficientLocalesProperty = "";
123

124
        @ManyToOne
125
        @JoinColumn(name = "creator", nullable = false)
126
        private User creator;
127

128
        @Column(name = "date_created", nullable = false, length = 19)
129
        private Date dateCreated;
130

131
        @ManyToOne
132
        @JoinColumn(name = "changed_by")
133
        private User changedBy;
134

135
        @Column(name = "date_changed", length = 19)
136
        private Date dateChanged;
137

138
        @Column(name = "retired", nullable = false, length = 1)
139
        private boolean retired;
140

141
        @ManyToOne
142
        @JoinColumn(name = "retired_by")
143
        private User retiredBy;
144

145
        @Column(name = "date_retired", length = 19)
146
        private Date dateRetired;
147

148
        @Column(name = "retire_reason", length = 255)
149
        private String retireReason;
150
        
151
        // Constructors
152
        
153
        /** default constructor */
154
        public User() {
1 ✔
155
        }
1 ✔
156
        
157
        /** constructor with id */
158
        public User(Integer userId) {
1 ✔
159
                this.userId = userId;
1 ✔
160
        }
1 ✔
161
        
162
        /** constructor with person object */
163
        public User(Person person) {
1 ✔
164
                this.person = person;
1 ✔
165
        }
1 ✔
166
        
167
        /**
168
         * Return true if this user has all privileges
169
         * 
170
         * @return true/false if this user is defined as a super user
171
         */
172
        public boolean isSuperUser() {
173
                return containsRole(RoleConstants.SUPERUSER);
1 ✔
174
        }
175
        
176
        /**
177
         * This method shouldn't be used directly. Use org.openmrs.api.context.Context#hasPrivilege so that
178
         * anonymous/authenticated/proxy privileges are all included Return true if this user has the
179
         * specified privilege
180
         * 
181
         * @param privilege
182
         * @return true/false depending on whether user has specified privilege
183
         */
184
        public boolean hasPrivilege(String privilege) {
185
                
186
                // All authenticated users have the "" (empty) privilege
187
                if (StringUtils.isEmpty(privilege)) {
1 ✔
UNCOV
188
                        return true;
×
189
                }
190
                
191
                if (isSuperUser()) {
1 ✔
UNCOV
192
                        return true;
×
193
                }
194
                
195
                Set<Role> tmproles = getAllRoles();
1 ✔
196
                
197
                // loop over the roles and check each for the privilege
198
                for (Role tmprole : tmproles) {
1 ✔
199
                        if (tmprole.hasPrivilege(privilege)) {
1 ✔
200
                                return true;
1 ✔
201
                        }
UNCOV
202
                }
×
203
                
204
                return false;
1 ✔
205
        }
206
        
207
        /**
208
         * Check if this user has the given String role
209
         * 
210
         * @param r String name of a role to check
211
         * @return Returns true if this user has the specified role, false otherwise
212
         */
213
        public boolean hasRole(String r) {
214
                return hasRole(r, false);
1 ✔
215
        }
216
        
217
        /**
218
         * Checks if this user has the given String role
219
         * 
220
         * @param r String name of a role to check
221
         * @param ignoreSuperUser If this is false, then this method will always return true for a
222
         *            superuser.
223
         * @return Returns true if the user has the given role, or if ignoreSuperUser is false and the user
224
         *         is a superUser
225
         */
226
        public boolean hasRole(String r, boolean ignoreSuperUser) {
227
                if (!ignoreSuperUser && isSuperUser()) {
1 ✔
228
                        return true;
1 ✔
229
                }
230
                
231
                if (roles == null) {
1 ✔
UNCOV
232
                        return false;
×
233
                }
234
                
235
                Set<Role> tmproles = getAllRoles();
1 ✔
236
                
237
                log.debug("User # {} has roles: {}", userId, tmproles);
1 ✔
238
                
239
                return containsRole(r);
1 ✔
240
        }
241
        
242
        /**
243
         * Checks if the user has a given role. Role name comparisons are not case sensitive.
244
         * 
245
         * @param roleName the name of the role to check
246
         * @return true if the user has the given role, else false
247
         * <strong>Should</strong> return true if the user has the given role
248
         * <strong>Should</strong> return false if the user does not have the given role
249
         * <strong>Should</strong> be case insensitive
250
         */
251
        public boolean containsRole(String roleName) {
252
                for (Role role : getAllRoles()) {
1 ✔
253
                        if (role.getRole().equalsIgnoreCase(roleName)) {
1 ✔
254
                                return true;
1 ✔
255
                        }
256
                }
1 ✔
257
                return false;
1 ✔
258
        }
259
        
260
        /**
261
         * Get <i>all</i> privileges this user has. This delves into all of the roles that a person has,
262
         * appending unique privileges
263
         * 
264
         * @return Collection of complete Privileges this user has
265
         */
266
        public Collection<Privilege> getPrivileges() {
267
                Set<Privilege> privileges = new HashSet<>();
1 ✔
268
                Set<Role> tmproles = getAllRoles();
1 ✔
269
                
270
                Role role;
271
                for (Role tmprole : tmproles) {
1 ✔
272
                        role = tmprole;
1 ✔
273
                        Collection<Privilege> privs = role.getPrivileges();
1 ✔
274
                        if (privs != null) {
1 ✔
275
                                privileges.addAll(privs);
1 ✔
276
                        }
277
                }
1 ✔
278
                
279
                return privileges;
1 ✔
280
        }
281
        
282
        // Property accessors
283
        
284
        /**
285
         * Returns all roles attributed to this user by expanding the role list to include the parents of
286
         * the assigned roles
287
         * 
288
         * @return all roles (inherited from parents and given) for this user
289
         */
290
        public Set<Role> getAllRoles() {
291
                // the user's immediate roles
292
                Set<Role> baseRoles = new HashSet<>();
1 ✔
293
                
294
                // the user's complete list of roles including
295
                // the parent roles of their immediate roles
296
                Set<Role> totalRoles = new HashSet<>();
1 ✔
297
                if (getRoles() != null) {
1 ✔
298
                        baseRoles.addAll(getRoles());
1 ✔
299
                        totalRoles.addAll(getRoles());
1 ✔
300
                }
301
                
302
                log.debug("User's base roles: {}", baseRoles);
1 ✔
303
                
304
                try {
305
                        for (Role r : baseRoles) {
1 ✔
306
                                totalRoles.addAll(r.getAllParentRoles());
1 ✔
307
                        }
1 ✔
308
                }
309
                catch (ClassCastException e) {
×
310
                        log.error("Error converting roles for user: " + this);
×
311
                        log.error("baseRoles.class: " + baseRoles.getClass().getName());
×
312
                        log.error("baseRoles: " + baseRoles.toString());
×
313
                        for (Role baseRole : baseRoles) {
×
314
                                log.error("baseRole: '" + baseRole + "'");
×
UNCOV
315
                        }
×
316
                }
1 ✔
317
                return totalRoles;
1 ✔
318
        }
319
        
320
        /**
321
         * @return Returns the roles.
322
         */
323
        public Set<Role> getRoles() {
324
                return roles;
1 ✔
325
        }
326
        
327
        /**
328
         * @param roles The roles to set.
329
         */
330
        public void setRoles(Set<Role> roles) {
331
                this.roles = CollectionUtil.setCollection(this.roles, roles);
1 ✔
332
        }
1 ✔
333
        
334
        /**
335
         * Add the given Role to the list of roles for this User
336
         * 
337
         * @param role
338
         * @return Returns this user with the given role attached
339
         */
340
        public User addRole(Role role) {
341
                if (roles == null) {
1 ✔
342
                        roles = new HashSet<>();
1 ✔
343
                }
344
                if (!roles.contains(role) && role != null) {
1 ✔
345
                        roles.add(role);
1 ✔
346
                }
347
                
348
                return this;
1 ✔
349
        }
350
        
351
        /**
352
         * Remove the given Role from the list of roles for this User
353
         * 
354
         * @param role
355
         * @return this user with the given role removed
356
         */
357
        public User removeRole(Role role) {
358
                if (roles != null) {
1 ✔
359
                        roles.remove(role);
1 ✔
360
                }
361
                
362
                return this;
1 ✔
363
        }
364
        
365
        /**
366
         * @see org.openmrs.Attributable#findPossibleValues(java.lang.String)
367
         */
368
        @Override
369
        @Deprecated
370
        public List<User> findPossibleValues(String searchText) {
371
                try {
UNCOV
372
                        return Context.getUserService().getUsersByName(searchText, "", false);
×
373
                }
374
                catch (Exception e) {
×
UNCOV
375
                        return Collections.emptyList();
×
376
                }
377
        }
378
        
379
        /**
380
         * @see org.openmrs.Attributable#getPossibleValues()
381
         */
382
        @Override
383
        @Deprecated
384
        public List<User> getPossibleValues() {
385
                try {
UNCOV
386
                        return Context.getUserService().getAllUsers();
×
387
                }
388
                catch (Exception e) {
×
UNCOV
389
                        return Collections.emptyList();
×
390
                }
391
        }
392
        
393
        /**
394
         * @see org.openmrs.Attributable#hydrate(java.lang.String)
395
         */
396
        @Override
397
        public User hydrate(String userId) {
398
                try {
399
                        return Context.getUserService().getUser(Integer.valueOf(userId));
1 ✔
400
                }
401
                catch (Exception e) {
×
UNCOV
402
                        return new User();
×
403
                }
404
        }
405
        
406
        /**
407
         * @see org.openmrs.Attributable#serialize()
408
         */
409
        @Override
410
        public String serialize() {
411
                if (getUserId() != null) {
×
UNCOV
412
                        return "" + getUserId();
×
413
                } else {
UNCOV
414
                        return "";
×
415
                }
416
        }
417
        
418
        /**
419
         * @see org.openmrs.Attributable#getDisplayString()
420
         */
421
        @Override
422
        public String getDisplayString() {
423
                String returnString = "";
1 ✔
424
                if (getPersonName() != null) {
1 ✔
425
                        returnString += getPersonName().getFullName() + " ";
1 ✔
426
                }
427
                
428
                returnString += "(" + getUsername() + ")";
1 ✔
429
                return returnString;
1 ✔
430
                
431
        }
432
        
433
        /**
434
         * @return Returns the systemId.
435
         */
436
        public String getSystemId() {
437
                return systemId;
1 ✔
438
        }
439
        
440
        /**
441
         * @param systemId The systemId to set.
442
         */
443
        public void setSystemId(String systemId) {
444
                this.systemId = systemId;
1 ✔
445
        }
1 ✔
446
        
447
        /**
448
         * @return Returns the userId.
449
         */
450
        public Integer getUserId() {
451
                return userId;
1 ✔
452
        }
453
        
454
        /**
455
         * @param userId The userId to set.
456
         */
457
        public void setUserId(Integer userId) {
458
                this.userId = userId;
1 ✔
459
        }
1 ✔
460
        
461
        /**
462
         * @return the person
463
         * @since 1.6
464
         */
465
        public Person getPerson() {
466
                return person;
1 ✔
467
        }
468
        
469
        /**
470
         * @return the person, creating a new object if person is null
471
         */
472
        private Person getPersonMaybeCreate() {
473
                if (person == null) {
1 ✔
UNCOV
474
                        person = new Person();
×
475
                }
476
                return person;
1 ✔
477
        }
478
        
479
        /**
480
         * @param person the person to set
481
         * @since 1.6
482
         */
483
        public void setPerson(Person person) {
484
                this.person = person;
1 ✔
485
        }
1 ✔
486
        
487
        /**
488
         * @return Returns the username.
489
         */
490
        public String getUsername() {
491
                return username;
1 ✔
492
        }
493
        
494
        /**
495
         * @param username The username to set.
496
         */
497
        public void setUsername(String username) {
498
                this.username = username;
1 ✔
499
        }
1 ✔
500
        
501
        /**
502
         * @since 2.2
503
         * @return Returns the email.
504
         */
505
        public String getEmail() {
506
                return email;
1 ✔
507
        }
508
        
509
        /**
510
         * @since 2.2
511
         * @param email The email to set.
512
         */
513
        public void setEmail(String email) {
514
                this.email = email;
1 ✔
515
        }
1 ✔
516
        
517
        @Override
518
        public String toString() {
519
                return StringUtils.isNotBlank(username) ? username : systemId;
1 ✔
520
        }
521
        
522
        /**
523
         * @return Returns the userProperties.
524
         */
525
        public Map<String, String> getUserProperties() {
526
                if (userProperties == null) {
1 ✔
527
                        userProperties = new HashMap<>();
1 ✔
528
                }
529
                return userProperties;
1 ✔
530
        }
531
        
532
        /**
533
         * @param userProperties A Map&lt;String,String&gt; of the properties to set.
534
         */
535
        public void setUserProperties(Map<String, String> userProperties) {
536
                this.userProperties = userProperties;
1 ✔
537
        }
1 ✔
538
        
539
        /**
540
         * Convenience method. Adds the given property to the user's properties
541
         */
542
        public void setUserProperty(String prop, String value) {
543
                getUserProperties().put(prop, value);
1 ✔
544
        }
1 ✔
545
        
546
        /**
547
         * Convenience method. Removes the given property from the user's properties
548
         */
549
        public void removeUserProperty(String prop) {
550
                if (getUserProperties() != null && userProperties.containsKey(prop)) {
1 ✔
551
                        userProperties.remove(prop);
1 ✔
552
                }
553
        }
1 ✔
554
        
555
        /**
556
         * Get prop property from this user's properties. If prop is not found in properties, return empty
557
         * string
558
         * 
559
         * @param prop
560
         * @return property value
561
         */
562
        public String getUserProperty(String prop) {
563
                if (getUserProperties() != null && userProperties.containsKey(prop)) {
1 ✔
564
                        return userProperties.get(prop);
1 ✔
565
                }
566
                
567
                return "";
1 ✔
568
        }
569
        
570
        /**
571
         * Get prop property from this user's properties. If prop is not found in properties, return
572
         * <code>defaultValue</code>
573
         * 
574
         * @param prop
575
         * @param defaultValue
576
         * @return property value
577
         * @see #getUserProperty(java.lang.String)
578
         */
579
        public String getUserProperty(String prop, String defaultValue) {
580
                if (getUserProperties() != null && userProperties.containsKey(prop)) {
1 ✔
581
                        return userProperties.get(prop);
1 ✔
582
                }
583
                
584
                return defaultValue;
1 ✔
585
        }
586
        
587
        /**
588
         * @see Person#addName(PersonName)
589
         */
590
        public void addName(PersonName name) {
591
                getPersonMaybeCreate().addName(name);
1 ✔
592
        }
1 ✔
593
        
594
        /**
595
         * @see Person#getPersonName()
596
         */
597
        public PersonName getPersonName() {
598
                return getPerson() == null ? null : getPerson().getPersonName();
1 ✔
599
        }
600
        
601
        /**
602
         * Get givenName on the Person this user account belongs to
603
         * 
604
         * @see Person#getGivenName()
605
         */
606
        public String getGivenName() {
607
                return getPerson() == null ? null : getPerson().getGivenName();
1 ✔
608
        }
609
        
610
        /**
611
         * Get familyName on the Person this user account belongs to
612
         * 
613
         * @see Person#getFamilyName()
614
         */
615
        public String getFamilyName() {
UNCOV
616
                return getPerson() == null ? null : getPerson().getFamilyName();
×
617
        }
618
        
619
        /**
620
         * @see org.openmrs.Person#getNames()
621
         */
622
        public Set<PersonName> getNames() {
623
                return person.getNames();
1 ✔
624
        }
625
        
626
        /**
627
         * Returns a list of Locales for which the User is considered proficient.
628
         * 
629
         * @return List of the User's proficient locales
630
         */
631
        public List<Locale> getProficientLocales() {
632
                String proficientLocalesProperty = getUserProperty(OpenmrsConstants.USER_PROPERTY_PROFICIENT_LOCALES);
1 ✔
633
                
634
                if ((proficientLocales == null)
1 ✔
UNCOV
635
                        || (!OpenmrsUtil.nullSafeEquals(parsedProficientLocalesProperty, proficientLocalesProperty))) {
×
636
                        parsedProficientLocalesProperty = proficientLocalesProperty;
1 ✔
637
                        proficientLocales = new ArrayList<>();
1 ✔
638
                        if (proficientLocalesProperty != null) {
1 ✔
639
                                String[] proficientLocalesArray = proficientLocalesProperty.split(",");
1 ✔
640
                                for (String proficientLocaleSpec : proficientLocalesArray) {
1 ✔
641
                                        if (proficientLocaleSpec.length() > 0) {
1 ✔
642
                                                Locale proficientLocale = LocaleUtility.fromSpecification(proficientLocaleSpec);
1 ✔
643
                                                if (!proficientLocales.contains(proficientLocale)) {
1 ✔
644
                                                        proficientLocales.add(proficientLocale);
1 ✔
645
                                                        if (StringUtils.isNotEmpty(proficientLocale.getCountry())) {
1 ✔
646
                                                                // add the language also
647
                                                                Locale languageOnlyLocale = LocaleUtility.fromSpecification(proficientLocale.getLanguage());
1 ✔
648
                                                                if (!proficientLocales.contains(languageOnlyLocale)) {
1 ✔
649
                                                                        proficientLocales.add(LocaleUtility.fromSpecification(proficientLocale.getLanguage()));
1 ✔
650
                                                                }
651
                                                        }
652
                                                }
653
                                        }
654
                                }
655
                        }
656
                }
657
                
658
                // return a copy so that the list isn't changed by other processes
659
                return new ArrayList<>(proficientLocales);
1 ✔
660
        }
661
        
662
        /**
663
         * @since 1.5
664
         * @see org.openmrs.OpenmrsObject#getId()
665
         */
666
        @Override
667
        public Integer getId() {
668
                return getUserId();
1 ✔
669
        }
670
        
671
        /**
672
         * @since 1.5
673
         * @see org.openmrs.OpenmrsObject#setId(java.lang.Integer)
674
         */
675
        @Override
676
        public void setId(Integer id) {
677
                setUserId(id);
×
UNCOV
678
        }
×
679
        
680
        @Override
681
        public User getCreator() {
682
                return creator;
1 ✔
683
        }
684

685
        @Override
686
        public void setCreator(User creator) {
687
                this.creator = creator;
×
UNCOV
688
        }
×
689
        
690
    @Override
691
        public Date getDateCreated() {
692
                return dateCreated;
1 ✔
693
        }
694

695
        @Override
696
        public void setDateCreated(Date dateCreated) {
697
                this.dateCreated = dateCreated;
1 ✔
698
        }
1 ✔
699

700
        @Override
701
        public User getChangedBy() {
UNCOV
702
                return changedBy;
×
703
        }
704

705
        @Override
706
        public void setChangedBy(User changedBy) {
707
                this.changedBy = changedBy;
1 ✔
708
        }
1 ✔
709

710
        @Override
711
        public Date getDateChanged() {
712
                return dateChanged;
1 ✔
713
        }
714

715
        @Override
716
        public void setDateChanged(Date dateChanged) {
717
                this.dateChanged = dateChanged;
1 ✔
718
        }
1 ✔
719

720
        @Override
721
        public Boolean isRetired() {
722
                return retired;
1 ✔
723
        }
724
        
725
    @Override
726
        public Boolean getRetired() {
727
                return retired;
1 ✔
728
        }
729

730
        @Override
731
        public void setRetired(Boolean retired) {
732
                this.retired = retired;
1 ✔
733
        }
1 ✔
734

735
        @Override
736
        public User getRetiredBy() {
737
                return retiredBy;
1 ✔
738
        }
739

740
        @Override
741
        public void setRetiredBy(User retiredBy) {
742
                this.retiredBy = retiredBy;
1 ✔
743
        }
1 ✔
744

745
        @Override
746
        public Date getDateRetired() {
747
                return dateRetired;
1 ✔
748
        }
749

750
        @Override
751
        public void setDateRetired(Date dateRetired) {
752
                this.dateRetired = dateRetired;
1 ✔
753
        }
1 ✔
754

755
        @Override
756
        public String getRetireReason() {
757
                return retireReason;
1 ✔
758
        }
759

760
        @Override
761
        public void setRetireReason(String retireReason) {
762
                this.retireReason = retireReason;
1 ✔
763
        }
1 ✔
764
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE TRIAL · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc