Implemented error code converter

This commit is contained in:
CappielloAntonio
2021-07-25 14:41:19 +02:00
parent 3eacbc36d0
commit 5e9d1fd16d
2 changed files with 31 additions and 23 deletions

View File

@@ -0,0 +1,16 @@
package com.cappielloantonio.play.subsonic.utils.converter;
import com.cappielloantonio.play.subsonic.models.ErrorCode;
import com.tickaroo.tikxml.TypeConverter;
public class ErrorCodeConverter implements TypeConverter<ErrorCode> {
@Override
public ErrorCode read(String value) throws Exception {
return new ErrorCode(Integer.valueOf(value));
}
@Override
public String write(ErrorCode value) throws Exception {
return String.valueOf(value.getValue());
}
}