View Javadoc
1   /*
2    * Copyright (c) 2023. Roland T. Lichti, Kaiserpfalz EDV-Service.
3    *
4    * This program is free software: you can redistribute it and/or modify
5    * it under the terms of the GNU General Public License as published by
6    * the Free Software Foundation, either version 3 of the License, or
7    * (at your option) any later version.
8    *
9    * This program is distributed in the hope that it will be useful,
10   * but WITHOUT ANY WARRANTY; without even the implied warranty of
11   * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12   * GNU General Public License for more details.
13   *
14   * You should have received a copy of the GNU General Public License
15   * along with this program.  If not, see <https://www.gnu.org/licenses/>.
16   */
17  
18  package de.kaiserpfalzedv.commons.core.user;
19  
20  import org.eclipse.microprofile.openapi.annotations.media.Schema;
21  
22  import com.fasterxml.jackson.annotation.JsonIgnore;
23  import com.fasterxml.jackson.annotation.JsonInclude;
24  
25  import de.kaiserpfalzedv.commons.api.user.UserData;
26  import de.kaiserpfalzedv.commons.core.resources.DefaultResourceSpecImpl;
27  import de.kaiserpfalzedv.commons.core.resources.PointerImpl;
28  import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
29  import lombok.AllArgsConstructor;
30  import lombok.Builder;
31  import lombok.EqualsAndHashCode;
32  import lombok.Getter;
33  import lombok.NoArgsConstructor;
34  import lombok.ToString;
35  import lombok.experimental.SuperBuilder;
36  import lombok.extern.jackson.Jacksonized;
37  
38  /**
39   * The basic data for every user.
40   *
41   * @author klenkes74 {@literal <rlichti@kaiserpfalz-edv.de>}
42   * @since 2.0.0  2021-05-24
43   */
44  @Jacksonized
45  @SuperBuilder(toBuilder = true)
46  @AllArgsConstructor
47  @NoArgsConstructor
48  @Getter
49  @ToString
50  @EqualsAndHashCode(callSuper = true)
51  @JsonInclude(JsonInclude.Include.NON_ABSENT)
52  @Schema(name = "userData", description = "Registered User.")
53  public class UserDataImpl extends DefaultResourceSpecImpl implements UserData {
54      private static final long serialVersionUID = 0L;
55  
56      private static final String[] STRUCTURED_PROPERTIES = {
57              ISSUER,
58              SUBJECT
59      };
60  
61      @Builder.Default
62      private String name = null;
63  
64      @Builder.Default
65      private String description = null;
66      @Builder.Default
67      private PointerImpl picture = null;
68  
69      @SuppressFBWarnings(value = "EI_EXPOSE_REF", justification = "It's the API design.")
70      @JsonIgnore
71      @Override
72      public String[] getDefaultProperties() {
73          return STRUCTURED_PROPERTIES;
74      }
75  
76  }