19 package org.turro.entities.graph;
21 import java.util.Objects;
22 import org.turro.html.Colors;
23 import org.turro.path.Path;
31 private final String entityPath, name;
32 private boolean source;
35 this.entityPath = entityPath;
48 return switch(Path.pathFrom(entityPath).getRoot()) {
49 case "contact" -> (source ?
"#fbbd08" :
"#a5673f");
50 case "dossier-category" ->
"#e03997";
51 case "dossier" ->
"#a333c8";
52 case "issue" ->
"#6435c9";
53 case "publication" ->
"#21ba45";
59 return Colors.of(
getColor()).font().css();
72 private String escape(String value) {
73 return value.replaceAll(
"\\{",
"(")
74 .replaceAll(
"\\}",
")")
75 .replaceAll(
"[\\&\\#\\$\\:]",
"_")
76 .replaceAll(
"[\"\']",
"-");
82 hash = 29 * hash + Objects.hashCode(this.entityPath);
94 if (getClass() != obj.getClass()) {
98 return Objects.
equals(this.entityPath, other.entityPath);
void setSource(boolean source)
EntityVertex(String entityPath, String name)
boolean equals(Object obj)