Autopsy  4.12.0
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  */
19 package org.sleuthkit.autopsy.timeline.ui.listvew.datamodel;
20 
21 import java.util.Collections;
22 import java.util.HashMap;
23 import java.util.HashSet;
24 import java.util.Map;
25 import java.util.Objects;
26 import java.util.Set;
27 import org.sleuthkit.datamodel.TimelineEventType;
28 
34 public class CombinedEvent {
35 
36  private final long epochMillis;
37 
41  private final Map<TimelineEventType, Long> eventTypeMap = new HashMap<>();
42 
51  public CombinedEvent(long epochMillis, Map<TimelineEventType, Long> eventMap) {
52  this.epochMillis = epochMillis;
53  eventTypeMap.putAll(eventMap);
54 
55  }
56 
62  public long getStartMillis() {
63  return epochMillis;
64  }
65 
71  public Set<TimelineEventType> getEventTypes() {
72  return eventTypeMap.keySet();
73  }
74 
80  public Set<Long> getEventIDs() {
81  return Collections.unmodifiableSet(new HashSet<>(eventTypeMap.values()));
82  }
83 
91  public Long getRepresentativeEventID() {
92  return eventTypeMap.values().stream().findFirst().get();
93  }
94 
95  @Override
96  public int hashCode() {
97  int hash = 3;
98  hash = 53 * hash + (int) (this.epochMillis ^ (this.epochMillis >>> 32));
99  hash = 53 * hash + Objects.hashCode(this.eventTypeMap);
100  return hash;
101  }
102 
103  @Override
104  public boolean equals(Object obj) {
105  if (this == obj) {
106  return true;
107  }
108  if (obj == null) {
109  return false;
110  }
111  if (getClass() != obj.getClass()) {
112  return false;
113  }
114  final CombinedEvent other = (CombinedEvent) obj;
115 
116  if (this.epochMillis != other.epochMillis) {
117  return false;
118  }
119 
120  return Objects.equals(this.eventTypeMap, other.eventTypeMap);
121  }
122 }
CombinedEvent(long epochMillis, Map< TimelineEventType, Long > eventMap)

Copyright © 2012-2018 Basis Technology. Generated on: Wed Sep 18 2019
This work is licensed under a Creative Commons Attribution-Share Alike 3.0 United States License.