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.services.sms77.model;
19  
20  import java.io.Serializable;
21  import java.util.Set;
22  import java.util.UUID;
23  
24  import com.fasterxml.jackson.annotation.JsonInclude;
25  
26  import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
27  import jakarta.validation.constraints.Max;
28  import jakarta.validation.constraints.Min;
29  import jakarta.validation.constraints.Pattern;
30  import jakarta.validation.constraints.Size;
31  import lombok.AllArgsConstructor;
32  import lombok.Builder;
33  import lombok.EqualsAndHashCode;
34  import lombok.Getter;
35  import lombok.NoArgsConstructor;
36  import lombok.ToString;
37  import lombok.experimental.SuperBuilder;
38  import lombok.extern.jackson.Jacksonized;
39  
40  /**
41   * <p>Sms -- .</p>
42   *
43   * @author rlichti {@literal <rlichti@kaiserpfalz-edv.de>}
44   * @since 1.0.0  2023-01-21
45   */
46  @SuppressFBWarnings(value = {"EI_EXPOSE_REP","EI_EXPOSE_REP2"}, justification = "lombok provided @Getter are created")
47  @Jacksonized
48  @SuperBuilder(toBuilder = true)
49  @AllArgsConstructor
50  @NoArgsConstructor
51  @Getter
52  @ToString(onlyExplicitlyIncluded = true)
53  @EqualsAndHashCode(onlyExplicitlyIncluded = true)
54  @JsonInclude(JsonInclude.Include.NON_ABSENT)
55  public class Sms implements Serializable {
56      private static final long serialVersionUID = 0L;
57  
58      @Size(max = 11)
59      private String from;
60  
61      private Set<String> to;
62  
63      @Size(max = 1520)
64      private String text;
65  
66      @Builder.Default
67      @Min(0) @Max(1)
68      private int no_reload = 1;
69  
70      @Builder.Default
71      @Min(0) @Max(1)
72      private int flash = 0;
73  
74      @Builder.Default
75      private String ttl = "60";
76  
77      @Builder.Default
78      @Min(0) @Max(1)
79      private int return_msg_id = 1;
80  
81      @Builder.Default
82      @Size(max = 64)
83      private String foreign_id = UUID.randomUUID().toString();
84  
85      @Size(max = 100)
86      @Pattern(regexp = "^[-._@ a-zA-Z0-9]+$")
87      private String label;
88  }