case HOME:
return new HomeConsumer(te);
case MENTIONS:
return new MentionsConsumer(te);
case PUBLIC:
return new PublicConsumer(te);
case RETWEETSOFME:
return new RetweetsConsumer(te);
case USER:
if (te.getProperties().getUser() == null || te.getProperties().getUser().trim().isEmpty()) {
throw new IllegalArgumentException("Fetch type set to USER TIMELINE but no user was set.");
} else {
return new UserConsumer(te);
}
default:
break;
}
}
break;
case TRENDS:
if (uriSplit.length > 1) {
switch (TrendsType.fromUri(uriSplit[1])) {
case DAILY:
return new DailyTrendConsumer(te);
case WEEKLY:
return new WeeklyTrendConsumer(te);
default:
break;
}
}
break;
default:
break;
}
}
LOG.warn("A consumer type was not provided (or an incorrect pairing was used). Defaulting to Public Timeline!");
return new PublicConsumer(te);
}