Added as type for backward compatibility

This commit is contained in:
Marcin Grzejszczak
2018-12-17 09:03:02 +01:00
parent 46056aa783
commit 296f9c5091

View File

@@ -66,4 +66,14 @@ class FromFileProperty implements Serializable {
return this.file.bytes
}
public <T> T asType(T type) {
switch (type) {
case String:
return (T) asString()
case byte[]:
return (T) asBytes()
}
throw new UnsupportedOperationException("Can't cast to type [${type}]")
}
}