Skip to content
This repository was archived by the owner on Aug 29, 2024. It is now read-only.

Commit b9d9fa0

Browse files
committed
Try to add objects adaptation (Map -> Analyzer|... conversion)
1 parent e66d0f6 commit b9d9fa0

File tree

2 files changed

+22
-0
lines changed

2 files changed

+22
-0
lines changed

Diff for: src/main/java/org/idmef/Analyzer.java

+11
Original file line numberDiff line numberDiff line change
@@ -27,3 +27,14 @@ public Analyzer(Map<String, Object> map) {
2727
super(map);
2828
}
2929
}
30+
31+
class AnalyzerAdapter implements IDMEFObjectAdapter {
32+
33+
@Override
34+
public IDMEFObject convert(Object o) throws IDMEFObjectAdaptException {
35+
if (! (Map.class.isInstance(o)))
36+
throw new IDMEFObjectAdaptException("adapter argument is not a Map");
37+
38+
return null;
39+
}
40+
}

Diff for: src/main/java/org/idmef/IDMEFObjectAdapter.java

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
package org.idmef;
2+
3+
class IDMEFObjectAdaptException extends Exception {
4+
public IDMEFObjectAdaptException(String message) {
5+
super(message);
6+
}
7+
}
8+
9+
interface IDMEFObjectAdapter {
10+
IDMEFObject convert(Object o) throws IDMEFObjectAdaptException;
11+
}

0 commit comments

Comments
 (0)