Autopsy 4.22.1
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 */
19package org.sleuthkit.autopsy.timeline.zooming;
20
21import java.util.Objects;
22import org.joda.time.Interval;
23import org.sleuthkit.autopsy.timeline.ui.filtering.datamodel.RootFilterState;
24import org.sleuthkit.datamodel.TimelineEventType;
25import org.sleuthkit.datamodel.TimelineLevelOfDetail;
26
32final 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;
41 this.eventTypesHierarchyLevel = eventTypesHierarchyLevel;
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
57
58 public TimelineLevelOfDetail getTimelineLOD() {
59 return timelineLOD;
60 }
61
62 public EventsModelParams withTimeAndType(Interval timeRange, TimelineEventType.HierarchyLevel zoomLevel) {
64 }
65
66 public EventsModelParams withTypeZoomLevel(TimelineEventType.HierarchyLevel zoomLevel) {
68 }
69
73
74 public EventsModelParams withDescrLOD(TimelineLevelOfDetail descrLOD) {
76 }
77
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 }
122 if (this.eventTypesHierarchyLevel != other.getEventTypesHierarchyLevel()) {
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 withTypeZoomLevel(TimelineEventType.HierarchyLevel zoomLevel)
EventsModelParams withDescrLOD(TimelineLevelOfDetail descrLOD)
final TimelineEventType.HierarchyLevel eventTypesHierarchyLevel
EventsModelParams(Interval timeRange, TimelineEventType.HierarchyLevel eventTypesHierarchyLevel, RootFilterState eventFilterState, TimelineLevelOfDetail timelineLOD)
EventsModelParams withTimeAndType(Interval timeRange, TimelineEventType.HierarchyLevel zoomLevel)
boolean hasTypeZoomLevel(TimelineEventType.HierarchyLevel typeZoom)
EventsModelParams withFilterState(RootFilterState filter)
TimelineEventType.HierarchyLevel getEventTypesHierarchyLevel()

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