19 package org.turro.dossier.entity;
21 import java.util.ArrayList;
22 import java.util.List;
23 import java.util.Objects;
25 import java.util.TreeSet;
26 import javax.persistence.Column;
27 import javax.persistence.Entity;
28 import javax.persistence.GeneratedValue;
29 import javax.persistence.GenerationType;
30 import javax.persistence.Id;
31 import javax.persistence.Lob;
32 import javax.persistence.ManyToOne;
33 import org.turro.string.ObjectString;
34 import org.turro.string.Strings;
35 import org.turro.dossier.www.WorthPair;
36 import org.turro.jpa.entity.IDaoEntity;
46 @GeneratedValue(strategy=GenerationType.IDENTITY)
47 @Column(name=
"IDENTIFIER")
50 private String title, possibleValues, colors, grouping;
54 private String description;
76 return possibleValues;
80 this.possibleValues = possibleValues;
96 this.grouping = grouping;
104 this.description = description;
112 this.category = category;
120 this._dossier = _dossier;
125 transient List<WorthValue> _values;
139 total += v.getValue();
145 if(_values ==
null) {
146 _values =
new ArrayList<>();
148 if(Objects.equals(v.getWorthDefinition().getId(),
id)) {
160 total += v.getValue();
189 return Strings.isBlank(title) || Strings.isBlank(possibleValues);
195 List<WorthPair> list =
new ArrayList<>();
196 String[] sa = possibleValues.split(
",");
197 String[] co = colors.split(
",");
198 if(sa.length == co.length) {
199 for(
int i = 0; i < sa.length; i++) {
200 list.add(
new WorthPair((Double) ObjectString.parseString(sa[i], Double.class,
true), co[i]));
207 TreeSet<WorthPair>
set =
new TreeSet<>();
218 set.add(
new WorthPair(wp.getValue() + (diff / 2.0), wp.getColor()));
Set< WorthValue > getWorths()
void assignDossier(Dossier dossier)
void setColors(String colors)
Set< WorthPair > getRangeValues()
String getPossibleValues()
Dossier getAssignedDossier()
void setDossier(Dossier _dossier)
void setCategory(Category category)
WorthPair getRangeResult()
void setGrouping(String grouping)
List< WorthValue > getWorthValues()
List< WorthPair > getPairValues()
void setTitle(String title)
void setPossibleValues(String possibleValues)
void setDescription(String description)