Autopsy 4.22.1
Graphical digital forensics platform for The Sleuth Kit and other tools.
CombinedEvent.java
Go to the documentation of this file.
1/*
2 * Autopsy Forensic Browser
3 *
4 * Copyright 2018-2019 Basis Technology Corp.
5 * Contact: carrier <at> sleuthkit <dot> org
6 *
7 * Licensed under the Apache License, Version 2.0 (the "License");
8 * you may not use this file except in compliance with the License.
9 * You may obtain a copy of the License at
10 *
11 * http://www.apache.org/licenses/LICENSE-2.0
12 *
13 * Unless required by applicable law or agreed to in writing, software
14 * distributed under the License is distributed on an "AS IS" BASIS,
15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 * See the License for the specific language governing permissions and
17 * limitations under the License.
18 */
19package org.sleuthkit.autopsy.timeline.ui.listvew.datamodel;
20
21import java.util.Collections;
22import java.util.HashMap;
23import java.util.HashSet;
24import java.util.Map;
25import java.util.Objects;
26import java.util.Set;
27import org.sleuthkit.datamodel.TimelineEventType;
28
34public class CombinedEvent {
35
36 private final long epochMillis;
37
41 private final Map<TimelineEventType, Long> eventTypeMap = new HashMap<>();
42
50 public CombinedEvent(long epochMillis, Map<TimelineEventType, Long> eventMap) {
51 this.epochMillis = epochMillis;
52 eventTypeMap.putAll(eventMap);
53
54 }
55
61 public long getStartMillis() {
62 return epochMillis;
63 }
64
70 public Set<TimelineEventType> getEventTypes() {
71 return eventTypeMap.keySet();
72 }
73
79 public Set<Long> getEventIDs() {
80 return Collections.unmodifiableSet(new HashSet<>(eventTypeMap.values()));
81 }
82
91 return eventTypeMap.values().stream().findFirst().get();
92 }
93
94 @Override
95 public int hashCode() {
96 int hash = 3;
97 hash = 53 * hash + (int) (this.epochMillis ^ (this.epochMillis >>> 32));
98 hash = 53 * hash + Objects.hashCode(this.eventTypeMap);
99 return hash;
100 }
101
102 @Override
103 public boolean equals(Object obj) {
104 if (this == obj) {
105 return true;
106 }
107 if (obj == null) {
108 return false;
109 }
110 if (getClass() != obj.getClass()) {
111 return false;
112 }
113 final CombinedEvent other = (CombinedEvent) obj;
114
115 if (this.epochMillis != other.epochMillis) {
116 return false;
117 }
118
119 return Objects.equals(this.eventTypeMap, other.eventTypeMap);
120 }
121}
CombinedEvent(long epochMillis, Map< TimelineEventType, Long > eventMap)

Copyright © 2012-2024 Sleuth Kit Labs. Generated on:
This work is licensed under a Creative Commons Attribution-Share Alike 3.0 United States License.