mirror of
https://github.com/CappielloAntonio/tempo.git
synced 2026-02-01 23:13:36 +00:00
Implemented error code converter
This commit is contained in:
@@ -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());
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user