19 package org.sleuthkit.autopsy.timeline.datamodel;
21 import com.google.common.base.Preconditions;
22 import com.google.common.collect.ImmutableSet;
23 import com.google.common.collect.ImmutableSortedSet;
24 import java.util.Comparator;
25 import java.util.Objects;
26 import java.util.Optional;
27 import java.util.SortedSet;
28 import javax.annotation.concurrent.Immutable;
40 Preconditions.checkNotNull(u);
41 Preconditions.checkNotNull(v);
43 Preconditions.checkArgument(Objects.equals(u.
lod, v.
lod));
44 Preconditions.checkArgument(Objects.equals(u.
type, v.
type));
45 Preconditions.checkArgument(Objects.equals(u.
parent, v.
parent));
51 private final ImmutableSortedSet<EventCluster>
clusters;
77 private final ImmutableSet<Long>
tagged;
85 if (java.util.Objects.nonNull(
this.parent)) {
86 throw new IllegalStateException(
"Event Stripe already has a parent!");
88 return new EventStripe(parent, this.type, this.description, this.lod, clusters, eventIDs, tagged, hashHits);
126 eventIDs = ImmutableSet.<Long>builder()
130 tagged = ImmutableSet.<Long>builder()
134 hashHits = ImmutableSet.<Long>builder()
143 return Optional.ofNullable(parent);
150 return Optional.empty();
186 return clusters.first().getStartMillis();
191 return clusters.last().getEndMillis();
201 return "EventStripe{" +
"description=" + description +
", eventIDs=" + (Objects.isNull(eventIDs) ? 0 : eventIDs.size()) +
'}';
207 hash = 79 * hash + Objects.hashCode(this.clusters);
208 hash = 79 * hash + Objects.hashCode(this.type);
209 hash = 79 * hash + Objects.hashCode(this.description);
210 hash = 79 * hash + Objects.hashCode(this.lod);
211 hash = 79 * hash + Objects.hashCode(this.eventIDs);
223 if (getClass() != obj.getClass()) {
227 if (!Objects.equals(
this.description, other.
description)) {
230 if (!Objects.equals(
this.clusters, other.
clusters)) {
233 if (!Objects.equals(
this.type, other.
type)) {
236 if (this.lod != other.
lod) {
239 if (!Objects.equals(
this.eventIDs, other.
eventIDs)) {
ImmutableSet< Long > getEventIDsWithHashHits()
Optional< EventCluster > getParent()
EventStripe(EventCluster parent, EventType type, String description, DescriptionLoD lod, SortedSet< EventCluster > clusters, ImmutableSet< Long > eventIDs, ImmutableSet< Long > tagged, ImmutableSet< Long > hashHits)
boolean equals(Object obj)
final ImmutableSet< Long > eventIDs
EventStripe withParent(EventCluster parent)
Optional< EventStripe > getParentStripe()
DescriptionLoD getDescriptionLoD()
EventCluster withParent(EventStripe parent)
EventStripe(EventStripe u, EventStripe v)
ImmutableSet< Long > getEventIDs()
static EventStripe merge(EventStripe u, EventStripe v)
final ImmutableSet< Long > tagged
EventStripe(EventCluster cluster)
final EventCluster parent
final ImmutableSet< Long > hashHits
final ImmutableSortedSet< EventCluster > clusters
ImmutableSet< Long > getEventIDsWithTags()
ImmutableSet< Long > getEventIDsWithHashHits()
DescriptionLoD getDescriptionLoD()
ImmutableSortedSet< EventCluster > getClusters()
ImmutableSet< Long > getEventIDs()
ImmutableSet< Long > getEventIDsWithTags()