mirror of
https://github.com/msgpack/msgpack-c.git
synced 2025-03-22 16:33:49 +01:00
java: fixes MessagePackObject.convert(Template, T)
This commit is contained in:
parent
f6384e10bc
commit
3e939e3775
@ -143,8 +143,8 @@ public abstract class MessagePackObject implements Cloneable, MessagePackable {
|
||||
return convert(tmpl, null);
|
||||
}
|
||||
|
||||
public Object convert(Template tmpl, Object to) throws MessageTypeException {
|
||||
return tmpl.convert(this, to);
|
||||
public <T> T convert(Template tmpl, T to) throws MessageTypeException {
|
||||
return (T)tmpl.convert(this, to);
|
||||
}
|
||||
|
||||
public <T> T convert(Class<T> klass) throws MessageTypeException {
|
||||
@ -155,7 +155,7 @@ public abstract class MessagePackObject implements Cloneable, MessagePackable {
|
||||
return convert((Class<T>)to.getClass(), to);
|
||||
}
|
||||
|
||||
public <T> T convert(Class<T> klass, Object to) throws MessageTypeException {
|
||||
private <T> T convert(Class<T> klass, T to) throws MessageTypeException {
|
||||
// FIXME nullable?
|
||||
return (T)convert(new NullableTemplate(new ClassTemplate(klass)), to);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user