Skip to content

Commit b3e3a36

Browse files
committed
Merge pull request msgpack#33 from choplin/patch-1
overload convert method with Template parameter
2 parents 977e4e4 + 50d7709 commit b3e3a36

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

src/main/java/org/msgpack/MessagePack.java

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -556,6 +556,19 @@ public <T> T convert(Value v, Class<T> c) throws IOException {
556556
Template<T> tmpl = registry.lookup(c);
557557
return tmpl.read(new Converter(this, v), null);
558558
}
559+
560+
/**
561+
* Converts {@link org.msgpack.type.Value} object to object according to template
562+
*
563+
* @since 0.6.8
564+
* @param v
565+
* @param tmpl
566+
* @return
567+
* @throws IOException
568+
*/
569+
public <T> T convert(Value v, Template<T> tmpl) throws IOException {
570+
return tmpl.read(new Converter(this, v), null);
571+
}
559572

560573
/**
561574
* Unconverts specified object to {@link org.msgpack.type.Value} object.

0 commit comments

Comments
 (0)