View Javadoc
1   /*
2    * Copyright (c) 2022 Kaiserpfalz EDV-Service, Roland T. Lichti.
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.rpg.torg.model.items;
19  
20  import com.fasterxml.jackson.annotation.JsonInclude;
21  import de.kaiserpfalzedv.rpg.torg.model.core.Armor;
22  import de.kaiserpfalzedv.rpg.torg.model.core.Attack;
23  import de.kaiserpfalzedv.rpg.torg.model.core.Axiom;
24  import de.kaiserpfalzedv.rpg.torg.model.core.Cosm;
25  import lombok.AllArgsConstructor;
26  import lombok.Builder;
27  import lombok.Getter;
28  import lombok.ToString;
29  import lombok.extern.jackson.Jacksonized;
30  import org.eclipse.microprofile.openapi.annotations.media.Schema;
31  
32  import jakarta.validation.constraints.Min;
33  import jakarta.validation.constraints.Size;
34  import java.io.Serializable;
35  import java.util.HashSet;
36  import java.util.Set;
37  
38  /**
39   * ItemData -- Data for an item.
40   *
41   * @author klenkes74 {@literal <rlichti@kaiserpfalz-edv.de>}
42   * @since 1.2.0  2021-05-23
43   */
44  @SuppressWarnings("FieldMayBeFinal")
45  @Jacksonized
46  @Builder(toBuilder = true)
47  @AllArgsConstructor
48  @Getter
49  @ToString
50  @JsonInclude(JsonInclude.Include.NON_ABSENT)
51  @Schema(description = "Gear and equipment.")
52  public class ItemData implements Serializable {
53      @Size(max = 5000, message = "The textual description must not be larger than 5000 characters.")
54      @Schema(description = "A textual description of this spell.", nullable = true, maxLength = 5000)
55      private final String description;
56  
57      @Schema(description = "Notes to this spell.", minItems = 0)
58      @Builder.Default
59      private final Set<String> notes = new HashSet<>();
60  
61      @Schema(description = "Infos to this spell.", minItems = 0)
62      @Builder.Default
63      private final Set<String> info = new HashSet<>();
64  
65      @Schema(description = "The cosms for this gear.", minItems = 1)
66      @Builder.Default
67      private final Set<Cosm> cosms = new HashSet<>();
68  
69      @Schema(description = "The axioms of this spell", minItems = 1, maxItems = 2)
70      @Builder.Default
71      private final Set<Axiom> axioms = new HashSet<>();
72  
73      @Min(1)
74      @Schema(description = "The price in $.", minimum = "0")
75      @Builder.Default
76      private int price = 0;
77  
78      @Min(1)
79      @Schema(description = "The DN to get the equipment from the Delphi Council.", minimum = "1")
80      @Builder.Default
81      private int delphiDN = 10;
82  
83      @Schema(description = "Possible attack (most spells are treated as attack to use the CharSheet for rolling).", minItems = 0)
84      @Builder.Default
85      private final Set<Attack> attack = new HashSet<>();
86  
87      @Schema(description = "Possible armor (some spells provide armor depending on success levels).", minItems = 0)
88      @Builder.Default
89      private final Set<Armor> armor = new HashSet<>();
90  }