Hello all,
I am trying the following:
public class UserInfoMapper extends PropertyMap<User, UserInfo> {
@Override
protected void configure() {
Converter<byte[], Boolean> isBytesNotNull = new Converter<byte[], Boolean>() {
@Override
public Boolean convert(MappingContext<byte[], Boolean> context) {
return context.getSource() != null;
}
};
using(isBytesNotNull).map().setPhotoAvailable(source.getPhoto());
skip().setPhoto(null);
}
}
But I get the following compile error:
java: method setPhotoAvailable in class com.asics.model.UserInfo cannot be applied to given types;
required: boolean
found: byte[]
reason: actual argument byte[] cannot be converted to boolean by method invocation conversion
source.getPhoto() returns a byte[] while setPhotoAvailable(boolean) expects boolean
What is the right way to do this?
Thanks!