convert
This commit is contained in:
@@ -699,7 +699,7 @@ public final class ApiDocCommand {
|
||||
factory,
|
||||
logger,
|
||||
componentsMap,
|
||||
((SimpledCoder) member.getEncoder()).getType(),
|
||||
TypeToken.typeToClass(((SimpledCoder) member.getEncoder()).getType()),
|
||||
((SimpledCoder) member.getEncoder()).getType(),
|
||||
new LinkedHashMap<>(),
|
||||
true);
|
||||
@@ -756,7 +756,7 @@ public final class ApiDocCommand {
|
||||
}
|
||||
return sb + (array ? "_Array" : "_Collection");
|
||||
} else if (encodeable instanceof SimpledCoder) {
|
||||
Class stype = ((SimpledCoder) encodeable).getType();
|
||||
Class stype = TypeToken.typeToClass(((SimpledCoder) encodeable).getType());
|
||||
if (stype.isPrimitive()
|
||||
|| stype == Boolean.class
|
||||
|| Number.class.isAssignableFrom(stype)
|
||||
|
||||
@@ -110,9 +110,4 @@ public class OptionalCoder<R extends Reader, W extends Writer, T> extends Simple
|
||||
}
|
||||
return Optional.ofNullable(this.decoder.convertFrom(in));
|
||||
}
|
||||
|
||||
@Override
|
||||
public Class getType() {
|
||||
return Optional.class;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -32,7 +32,7 @@ public abstract class SimpledCoder<R extends Reader, W extends Writer, T>
|
||||
|
||||
@Override
|
||||
@SuppressWarnings("unchecked")
|
||||
public Class<T> getType() {
|
||||
public Type getType() {
|
||||
if (type == null) {
|
||||
Type[] ts = ((ParameterizedType) getClass().getGenericSuperclass()).getActualTypeArguments();
|
||||
type = ts[ts.length - 1];
|
||||
@@ -40,7 +40,7 @@ public abstract class SimpledCoder<R extends Reader, W extends Writer, T>
|
||||
throw new ConvertException(type + " is not class");
|
||||
}
|
||||
}
|
||||
return (Class<T>) type;
|
||||
return type;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user