BrightSide Workbench Full Report + Source Code
Skill.java
Go to the documentation of this file.
1 /*
2  * TurrĂ³ i Cutiller Foundation. License notice.
3  * Copyright (C) 2020 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.elephant.entities.db;
20 
21 import javax.persistence.Entity;
22 import javax.persistence.Id;
23 import javax.persistence.IdClass;
24 import org.turro.string.Strings;
25 import org.turro.entities.Entities;
26 import org.turro.entities.IElephantEntity;
27 
32 @Entity
33 @IdClass(SkillPK.class)
34 public class Skill implements java.io.Serializable {
35 
36  @Id private String skill;
37  @Id private String entityPath;
38 
39  private SkillType type;
40 
41  private boolean validated;
42 
43  public String getSkill() {
44  return skill;
45  }
46 
47  public void setSkill(String skill) {
48  this.skill = skill;
49  }
50 
51  public String getEntityPath() {
52  return entityPath;
53  }
54 
55  public void setEntityPath(String entityPath) {
56  this.entityPath = entityPath;
57  }
58 
59  public SkillType getType() {
60  return type;
61  }
62 
63  public void setType(SkillType type) {
64  this.type = type;
65  }
66 
67  public boolean isValidated() {
68  return validated;
69  }
70 
71  public void setValidated(boolean validated) {
72  this.validated = validated;
73  }
74 
75  /* Helpers */
76 
77  public boolean isEmpty() {
78  return Strings.isBlank(skill) || Strings.isBlank(entityPath) || type == null;
79  }
80 
82  return Entities.getController(entityPath);
83  }
84 
85 }
void setSkill(String skill)
Definition: Skill.java:47
void setType(SkillType type)
Definition: Skill.java:63
void setEntityPath(String entityPath)
Definition: Skill.java:55
void setValidated(boolean validated)
Definition: Skill.java:71
static IElephantEntity getController(String path)
Definition: Entities.java:78