Autopsy  4.20.0
Graphical digital forensics platform for The Sleuth Kit and other tools.
EventsModelParams.java
Go to the documentation of this file.
1 /*
2  * Autopsy Forensic Browser
3  *
4  * Copyright 2013-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.zooming;
20 
21 import java.util.Objects;
22 import org.joda.time.Interval;
24 import org.sleuthkit.datamodel.TimelineEventType;
25 import org.sleuthkit.datamodel.TimelineLevelOfDetail;
26 
32 final public class EventsModelParams {
33 
34  private final Interval timeRange;
35  private final TimelineEventType.HierarchyLevel eventTypesHierarchyLevel;
37  private final TimelineLevelOfDetail timelineLOD;
38 
39  public EventsModelParams(Interval timeRange, TimelineEventType.HierarchyLevel eventTypesHierarchyLevel, RootFilterState eventFilterState, TimelineLevelOfDetail timelineLOD) {
40  this.timeRange = timeRange;
42  this.eventFilterState = eventFilterState;
43  this.timelineLOD = timelineLOD;
44  }
45 
46  public Interval getTimeRange() {
47  return timeRange;
48  }
49 
50  public TimelineEventType.HierarchyLevel getEventTypesHierarchyLevel() {
52  }
53 
55  return eventFilterState;
56  }
57 
58  public TimelineLevelOfDetail getTimelineLOD() {
59  return timelineLOD;
60  }
61 
62  public EventsModelParams withTimeAndType(Interval timeRange, TimelineEventType.HierarchyLevel zoomLevel) {
63  return new EventsModelParams(timeRange, zoomLevel, eventFilterState, timelineLOD);
64  }
65 
66  public EventsModelParams withTypeZoomLevel(TimelineEventType.HierarchyLevel zoomLevel) {
67  return new EventsModelParams(timeRange, zoomLevel, eventFilterState, timelineLOD);
68  }
69 
70  public EventsModelParams withTimeRange(Interval timeRange) {
71  return new EventsModelParams(timeRange, eventTypesHierarchyLevel, eventFilterState, timelineLOD);
72  }
73 
74  public EventsModelParams withDescrLOD(TimelineLevelOfDetail descrLOD) {
75  return new EventsModelParams(timeRange, eventTypesHierarchyLevel, eventFilterState, descrLOD);
76  }
77 
79  return new EventsModelParams(timeRange, eventTypesHierarchyLevel, filter, timelineLOD);
80  }
81 
82  public boolean hasFilterState(RootFilterState filterSet) {
83  return this.eventFilterState.equals(filterSet);
84  }
85 
86  public boolean hasTypeZoomLevel(TimelineEventType.HierarchyLevel typeZoom) {
87  return this.eventTypesHierarchyLevel.equals(typeZoom);
88  }
89 
90  public boolean hasTimeRange(Interval timeRange) {
91  return this.timeRange != null && this.timeRange.equals(timeRange);
92  }
93 
94  public boolean hasDescrLOD(TimelineLevelOfDetail newLOD) {
95  return this.timelineLOD.equals(newLOD);
96  }
97 
98  @Override
99  public int hashCode() {
100  int hash = 3;
101  hash = 97 * hash + Objects.hashCode(this.timeRange.getStartMillis());
102  hash = 97 * hash + Objects.hashCode(this.timeRange.getEndMillis());
103  hash = 97 * hash + Objects.hashCode(this.eventTypesHierarchyLevel);
104  hash = 97 * hash + Objects.hashCode(this.eventFilterState);
105  hash = 97 * hash + Objects.hashCode(this.timelineLOD);
106 
107  return hash;
108  }
109 
110  @Override
111  public boolean equals(Object obj) {
112  if (obj == null) {
113  return false;
114  }
115  if (getClass() != obj.getClass()) {
116  return false;
117  }
118  final EventsModelParams other = (EventsModelParams) obj;
119  if (!Objects.equals(this.timeRange, other.getTimeRange())) {
120  return false;
121  }
123  return false;
124  }
125  if (this.eventFilterState.equals(other.getEventFilterState()) == false) {
126  return false;
127  }
128  return this.timelineLOD == other.getTimelineLOD();
129  }
130 
131  @Override
132  public String toString() {
133  return "ZoomState{" + "timeRange=" + timeRange + ", typeZoomLevel=" + eventTypesHierarchyLevel + ", filter=" + eventFilterState.getActiveFilter().toString() + ", descrLOD=" + timelineLOD + '}'; //NON-NLS
134  }
135 }
EventsModelParams withTimeAndType(Interval timeRange, TimelineEventType.HierarchyLevel zoomLevel)
EventsModelParams(Interval timeRange, TimelineEventType.HierarchyLevel eventTypesHierarchyLevel, RootFilterState eventFilterState, TimelineLevelOfDetail timelineLOD)
final TimelineEventType.HierarchyLevel eventTypesHierarchyLevel
EventsModelParams withTypeZoomLevel(TimelineEventType.HierarchyLevel zoomLevel)
TimelineEventType.HierarchyLevel getEventTypesHierarchyLevel()
boolean hasTypeZoomLevel(TimelineEventType.HierarchyLevel typeZoom)
EventsModelParams withDescrLOD(TimelineLevelOfDetail descrLOD)
EventsModelParams withFilterState(RootFilterState filter)

Copyright © 2012-2022 Basis Technology. Generated on: Tue Aug 1 2023
This work is licensed under a Creative Commons Attribution-Share Alike 3.0 United States License.