Search in sources :

Example 1 with UserImage

use of fi.otavanopisto.muikku.schooldata.entity.UserImage in project muikku by otavanopisto.

the class LocalUserSchoolDataBridge method listUserImagesByUserIdentifier.

/**
 * {@inheritDoc}
 */
@Override
public List<UserImage> listUserImagesByUserIdentifier(String userIdentifier) {
    List<UserImage> result = new ArrayList<>();
    List<LocalUserImage> images = localUserSchoolDataController.listUserImagesByUserIdentifier(userIdentifier);
    for (LocalUserImage image : images) {
        UserImage userImage = toLocalUserImageImpl(image);
        if (userImage != null) {
            result.add(userImage);
        } else {
            throw new SchoolDataBridgeInternalException("Unexpected error occured while listing LocalUserImages");
        }
    }
    return result;
}
Also used : LocalUserImage(fi.otavanopisto.muikku.plugins.schooldatalocal.model.LocalUserImage) UserImage(fi.otavanopisto.muikku.schooldata.entity.UserImage) LocalUserImage(fi.otavanopisto.muikku.plugins.schooldatalocal.model.LocalUserImage) SchoolDataBridgeInternalException(fi.otavanopisto.muikku.schooldata.SchoolDataBridgeInternalException) ArrayList(java.util.ArrayList)

Aggregations

LocalUserImage (fi.otavanopisto.muikku.plugins.schooldatalocal.model.LocalUserImage)1 SchoolDataBridgeInternalException (fi.otavanopisto.muikku.schooldata.SchoolDataBridgeInternalException)1 UserImage (fi.otavanopisto.muikku.schooldata.entity.UserImage)1 ArrayList (java.util.ArrayList)1