Autopsy  4.20.0
Graphical digital forensics platform for The Sleuth Kit and other tools.
Section.java
Go to the documentation of this file.
1 /*
2  * Autopsy Forensic Browser
3  *
4  * Copyright 2021 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.contentviewers.osaccount;
20 
21 import java.util.ArrayList;
22 import java.util.Iterator;
23 import java.util.List;
24 
29 final class Section implements Iterable<Section.SectionData> {
30 
31  private final String title;
32  private final List<SectionData> sectionData = new ArrayList<>();
33 
34  Section(String title) {
35  this.title = title;
36  }
37 
43  void addSectionData(SectionData data) {
44  sectionData.add(data);
45  }
46 
52  String getTitle() {
53  return title;
54  }
55 
56  @Override
57  public Iterator<SectionData> iterator() {
58  return sectionData.iterator();
59  }
60 
61  final static class SectionData implements Iterable<Section.RowData<String, String>> {
62 
63  private final String title;
64  private final List<RowData<String, String>> data;
65 
66  SectionData() {
67  this(null);
68  }
69 
75  SectionData(String title) {
76  this.title = title;
77  this.data = new ArrayList<>();
78  }
79 
85  String getTitle() {
86  return title;
87  }
88 
95  void addData(String properytName, String propertyValue) {
96  data.add(new RowData<>(properytName, propertyValue));
97  }
98 
99  @Override
100  public Iterator<RowData<String, String>> iterator() {
101  return data.iterator();
102  }
103  }
104 
111  static class RowData<K, V> {
112 
113  private final K key;
114  private final V value;
115 
122  RowData(K key, V value) {
123  this.key = key;
124  this.value = value;
125  }
126 
132  K getKey() {
133  return key;
134  }
135 
141  V getValue() {
142  return value;
143  }
144  }
145 }

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.