19 package org.sleuthkit.datamodel;
21 import java.util.Arrays;
22 import java.util.Comparator;
23 import java.util.ResourceBundle;
64 public class Score implements Comparable<Score> {
66 private static final ResourceBundle bundle = ResourceBundle.getBundle(
"org.sleuthkit.datamodel.Bundle");
88 UNKNOWN(0,
"Unknown",
"Significance.Unknown.displayName.text"),
91 LIKELY_NONE(8,
"LikelyNone",
"Significance.LikelyNone.displayName.text"),
94 LIKELY_NOTABLE(9,
"LikelyNotable",
"Significance.LikelyNotable.displayName.text"),
97 NONE(18,
"None",
"Significance.None.displayName.text"),
100 NOTABLE(19,
"Notable",
"Significance.Notable.displayName.text");
102 private final int id;
103 private final String name;
104 private final String displayNameKey;
106 private Significance(
int id, String name, String displayNameKey) {
109 this.displayNameKey = displayNameKey;
113 return Arrays.stream(values())
114 .filter(val -> val.getName().equals(name))
115 .findFirst().orElse(NONE);
119 return Arrays.stream(values())
120 .filter(val -> val.getId() == id)
121 .findFirst().orElse(NONE);
150 return bundle.getString(displayNameKey);
165 NORMAL(0,
"Normal",
"Score.Priority.Normal.displayName.text"),
166 OVERRIDE(10,
"Override",
"Score.Priority.Override.displayName.text");
168 private final int id;
169 private final String name;
170 private final String displayNameKey;
172 private Priority(
int id, String name, String displayNameKey) {
175 this.displayNameKey = displayNameKey;
179 return Arrays.stream(values())
180 .filter(val -> val.getName().equals(name))
181 .findFirst().orElse(NORMAL);
185 return Arrays.stream(values())
186 .filter(val -> val.getId() == id)
187 .findFirst().orElse(NORMAL);
199 return bundle.getString(displayNameKey);
220 this.significance = significance;
221 this.priority = priority;
UNKNOWN
no significance assigned yet.
static Priority fromID(int id)
static Significance fromID(int id)
Significance getSignificance()
static final Score SCORE_UNKNOWN
static final Score SCORE_NOTABLE
Score(Significance significance, Priority priority)
int compareTo(Score other)
static Priority fromString(String name)
static final Score SCORE_LIKELY_NONE
static final Score SCORE_NONE
static final Comparator< Score > getScoreComparator()
static final Score SCORE_LIKELY_NOTABLE
static Significance fromString(String name)
LIKELY_NOTABLE
likely bad, suspicious