mirror of
https://github.com/gabehf/tempus.git
synced 2026-03-15 02:06:00 -07:00
Implemented error code converter
This commit is contained in:
parent
3eacbc36d0
commit
5e9d1fd16d
2 changed files with 31 additions and 23 deletions
|
|
@ -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());
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue