BrightSide Workbench Full Report + Source Code
PublicationConstraint.java
Go to the documentation of this file.
1 /*
2  * TurrĂ³ i Cutiller Foundation. License notice.
3  * Copyright (C) 2023 Lluis TurrĂ³ Cutiller <http://www.turro.org/>
4  *
5  * This program is free software: you can redistribute it and/or modify
6  * it under the terms of the GNU Affero General Public License as published by
7  * the Free Software Foundation, either version 3 of the License, or
8  * (at your option) any later version.
9  *
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  * GNU Affero General Public License for more details.
14  *
15  * You should have received a copy of the GNU Affero General Public License
16  * along with this program. If not, see <http://www.gnu.org/licenses/>.
17  */
18 
19 package org.turro.publication.entity;
20 
21 import javax.persistence.Column;
22 import javax.persistence.Entity;
23 import javax.persistence.GeneratedValue;
24 import javax.persistence.GenerationType;
25 import javax.persistence.Id;
26 import javax.persistence.ManyToOne;
27 import org.turro.string.Strings;
28 
33 @Entity
34 public class PublicationConstraint implements java.io.Serializable {
35 
36  @Id
37  @GeneratedValue(strategy=GenerationType.IDENTITY)
38  @Column(name="IDENTIFIER")
39  private Long id;
40 
41  @ManyToOne
42  private PublicationCategory publicationCategory;
43 
44  private String keyId;
45 
46  private boolean optional;
47 
48  public Long getId() {
49  return id;
50  }
51 
52  public void setId(Long id) {
53  this.id = id;
54  }
55 
57  return publicationCategory;
58  }
59 
60  public void setPublicationCategory(PublicationCategory publicationCategory) {
61  this.publicationCategory = publicationCategory;
62  }
63 
64  public String getKeyId() {
65  return keyId;
66  }
67 
68  public void setKeyId(String keyId) {
69  this.keyId = keyId;
70  }
71 
72  public boolean isOptional() {
73  return optional;
74  }
75 
76  public void setOptional(boolean optional) {
77  this.optional = optional;
78  }
79 
80  /* Utils */
81 
82  public boolean isEmpty() {
83  return Strings.isBlank(keyId);
84  }
85 
86 }
void setPublicationCategory(PublicationCategory publicationCategory)