use of org.stepik.api.objects.courses.Courses in project intellij-plugins by StepicOrg.
the class CourseNode method loadData.
@Override
protected boolean loadData(@NotNull StepikApiClient stepikApiClient, long id) {
try {
Courses courses = stepikApiClient.courses().get().id(id).execute();
Course data;
if (!courses.isEmpty()) {
data = courses.getFirst();
} else {
data = new Course();
data.setId(id);
}
Course oldData = this.getData();
setData(data);
return oldData == null || !oldData.getUpdateDate().equals(data.getUpdateDate());
} catch (StepikClientException logged) {
logger.warn(String.format("Failed load course data id=%d", id), logged);
}
return true;
}
Aggregations