View Javadoc
1   /*
2    * Copyright (c) 2021 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.actors;
19  
20  import java.util.Optional;
21  
22  import org.eclipse.microprofile.openapi.annotations.media.Schema;
23  
24  import com.fasterxml.jackson.annotation.JsonInclude;
25  
26  import de.kaiserpfalzedv.rpg.torg.model.core.Cosm;
27  import lombok.AllArgsConstructor;
28  import lombok.Builder;
29  import lombok.Getter;
30  import lombok.NoArgsConstructor;
31  import lombok.ToString;
32  import lombok.extern.jackson.Jacksonized;
33  
34  /**
35   * Other --
36   *
37   * @author klenkes74 {@literal <rlichti@kaiserpfalz-edv.de>}
38   * @since 1.3.0  2021-06-04
39   */
40  @Jacksonized
41  @Builder(toBuilder = true)
42  @AllArgsConstructor
43  @NoArgsConstructor
44  @Getter
45  @ToString
46  @JsonInclude(JsonInclude.Include.NON_ABSENT)
47  @Schema(description = "Other calculated data")
48  public class Other {
49      private int move;
50      private int run;
51      private int toughness;
52      private int armor;
53      private int sizeBonus;
54      private String cosm;
55      private int possibilities;
56      private int posibilities;
57  
58      public Optional<Cosm> getCosm() {
59          if (cosm == null || cosm.isBlank())
60              return Optional.empty();
61  
62          return Cosm.mapFoundry(cosm);
63      }
64  }