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.perks.magic;
19  
20  import com.fasterxml.jackson.annotation.JsonInclude;
21  import de.kaiserpfalzedv.rpg.torg.model.actors.Clearance;
22  import de.kaiserpfalzedv.rpg.torg.model.core.Armor;
23  import de.kaiserpfalzedv.rpg.torg.model.core.Attack;
24  import de.kaiserpfalzedv.rpg.torg.model.core.Axiom;
25  import de.kaiserpfalzedv.rpg.torg.model.perks.Prerequisites;
26  import lombok.AllArgsConstructor;
27  import lombok.EqualsAndHashCode;
28  import lombok.Getter;
29  import lombok.ToString;
30  import lombok.experimental.SuperBuilder;
31  import lombok.extern.jackson.Jacksonized;
32  import org.eclipse.microprofile.openapi.annotations.media.Schema;
33  
34  import jakarta.validation.constraints.Size;
35  import java.io.Serializable;
36  import java.util.Set;
37  
38  /**
39   * SpellData -- Data for a single magic spell.
40   *
41   * @author klenkes74 {@literal <rlichti@kaiserpfalz-edv.de>}
42   * @since 1.2.0  2021-05-23
43   */
44  @Jacksonized
45  @SuperBuilder(toBuilder = true)
46  @AllArgsConstructor
47  @Getter
48  @ToString(onlyExplicitlyIncluded = true)
49  @EqualsAndHashCode(onlyExplicitlyIncluded = false)
50  @JsonInclude(JsonInclude.Include.NON_ABSENT)
51  @Schema(description = "The spell definition.")
52  public class SpellData 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      @ToString.Include
58      @EqualsAndHashCode.Include
59      @Schema(description = "The minimum clearance level for this spell.")
60      private final Clearance clearance;
61  
62      @ToString.Include
63      @EqualsAndHashCode.Include
64      @Schema(description = "The axioms of this spell", minItems = 1, maxItems = 2)
65      private final Set<Axiom> axioms;
66  
67      @Schema(description = "Notes to this spell.", minItems = 0)
68      private final Set<String> notes;
69  
70      @Schema(description = "Infos to this spell.", minItems = 0)
71      private final Set<String> info;
72  
73      @Schema(description = "Prerequisites for obtaining the spell", minItems = 0)
74      private final Set<Prerequisites> prerequisites;
75  
76      @Schema(description = "Possible attack (most spells are treated as attack to use the CharSheet for rolling).", minItems = 0)
77      private final Set<Attack> attack;
78  
79      @Schema(description = "Possible armor (some spells provide armor depending on success levels).", minItems = 0)
80      private final Set<Armor> armor;
81  }