@Override Request deserialize(Message genericMsg) { final Requests.TablesRequest msg = ProtobufService.castProtobufMessage(genericMsg, Requests.TablesRequest.class); String connectionId = null; if (msg.hasField(CONNECTION_ID_DESCRIPTOR)) { connectionId = msg.getConnectionId(); } String catalog = null; if (msg.hasField(CATALOG_DESCRIPTOR)) { catalog = msg.getCatalog(); } String schemaPattern = null; if (msg.hasField(SCHEMA_PATTERN_DESCRIPTOR)) { schemaPattern = msg.getSchemaPattern(); } String tableNamePattern = null; if (msg.hasField(TABLE_NAME_PATTERN_DESCRIPTOR)) { tableNamePattern = msg.getTableNamePattern(); } // Cannot determine if a value was set for a repeated field. Must use an extra boolean // parameter to distinguish an empty and null typeList. List<String> typeList = null; if (msg.getHasTypeList()) { typeList = msg.getTypeListList(); } return new TablesRequest(connectionId, catalog, schemaPattern, tableNamePattern, typeList); }
@Override Request deserialize(Message genericMsg) { final Requests.TablesRequest msg = ProtobufService.castProtobufMessage(genericMsg, Requests.TablesRequest.class); String connectionId = null; if (msg.hasField(CONNECTION_ID_DESCRIPTOR)) { connectionId = msg.getConnectionId(); } String catalog = null; if (msg.hasField(CATALOG_DESCRIPTOR)) { catalog = msg.getCatalog(); } String schemaPattern = null; if (msg.hasField(SCHEMA_PATTERN_DESCRIPTOR)) { schemaPattern = msg.getSchemaPattern(); } String tableNamePattern = null; if (msg.hasField(TABLE_NAME_PATTERN_DESCRIPTOR)) { tableNamePattern = msg.getTableNamePattern(); } // Cannot determine if a value was set for a repeated field. Must use an extra boolean // parameter to distinguish an empty and null typeList. List<String> typeList = null; if (msg.getHasTypeList()) { typeList = msg.getTypeListList(); } return new TablesRequest(connectionId, catalog, schemaPattern, tableNamePattern, typeList); }