Autopsy  3.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  Map<String, Object> map;
29  int id;
30  String name;
31 
38  public KeyValue(String name, Map<String, Object> map, int id) {
39  this.name = name;
40  this.map = map;
41  this.id = id;
42  }
43 
48  public KeyValue(String name, int id) {
49  this.name = name;
50  this.map = null;
51  this.id = id;
52  }
53 
54  public int getId() {
55  return id;
56  }
57 
58  public Map<String, Object> getMap() {
59  return map;
60  }
61 
62  public String getName() {
63  return name;
64  }
65 
70  public void addMap(Map<String,Object> inMap) {
71  this.map = inMap;
72  }
73 
74  @Override
75  public String getString() {
76  StringBuilder buffer = new StringBuilder();
77  buffer.append(name);
78  buffer.append("\n");
79  for(Map.Entry<String, Object> entry : map.entrySet()){
80  buffer.append(entry.getKey());
81  buffer.append(": ");
82  buffer.append(entry.getValue().toString());
83  buffer.append("\n");
84  }
85  return buffer.toString();
86  }
87 }
KeyValue(String name, Map< String, Object > map, int id)
Definition: KeyValue.java:38
void addMap(Map< String, Object > inMap)
Definition: KeyValue.java:70

Copyright © 2012-2015 Basis Technology. Generated on: Mon Oct 19 2015
This work is licensed under a Creative Commons Attribution-Share Alike 3.0 United States License.