Autopsy  4.19.1
Graphical digital forensics platform for The Sleuth Kit and other tools.
KeyValue.java
Go to the documentation of this file.
1 /*
2  * Autopsy Forensic Browser
3  *
4  * Copyright 2011 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.datamodel;
20 
21 import java.util.Map;
22 
27 public class KeyValue implements StringContent {
28 
29  Map<String, Object> map;
30  int id;
31  String name;
32 
40  public KeyValue(String name, Map<String, Object> map, int id) {
41  this.name = name;
42  this.map = map;
43  this.id = id;
44  }
45 
51  public KeyValue(String name, int id) {
52  this.name = name;
53  this.map = null;
54  this.id = id;
55  }
56 
57  public int getId() {
58  return id;
59  }
60 
61  public Map<String, Object> getMap() {
62  return map;
63  }
64 
65  public String getName() {
66  return name;
67  }
68 
74  public void addMap(Map<String, Object> inMap) {
75  this.map = inMap;
76  }
77 
78  @Override
79  public String getString() {
80  StringBuilder buffer = new StringBuilder();
81  buffer.append(name);
82  buffer.append("\n");
83  for (Map.Entry<String, Object> entry : map.entrySet()) {
84  buffer.append(entry.getKey());
85  buffer.append(": ");
86  buffer.append(entry.getValue().toString());
87  buffer.append("\n");
88  }
89  return buffer.toString();
90  }
91 }
Map< String, Object > getMap()
Definition: KeyValue.java:61
KeyValue(String name, Map< String, Object > map, int id)
Definition: KeyValue.java:40
void addMap(Map< String, Object > inMap)
Definition: KeyValue.java:74

Copyright © 2012-2021 Basis Technology. Generated on: Thu Sep 30 2021
This work is licensed under a Creative Commons Attribution-Share Alike 3.0 United States License.