public static UserCommand deserialize ( String serialized ) { int id = - 1 ; if ( TextUtils . isEmpty ( serialized ) ) { return new UserCommand ( id , null ) ; } String [ ] arr = serialized . split ( ":" , 2 ) ; try { id = Integer . parseInt ( arr [ 0 ] ) ; } catch ( NumberFormatException ignored ) { } String title = null ; if ( arr . length > 1 ) { title = arr [ 1 ] ; } return new UserCommand ( id , title ) ; }
Deserializes a user command from the given string .