static UiType? getUiType(int? uiValue) { switch (uiValue) { case 0: return UiType.VIEWED; case 1: return UiType.IN_LIST; } return null; }