Example #1
0
 public static PlayerUser mapFromAdminDto(PlayerUserDto dto) {
   PlayerUser playerUser = new PlayerUser();
   playerUser.setPlayer(dto.getPlayer());
   playerUser.setEmail(dto.getEmail());
   playerUser.setImageUrl(dto.getImageUrl());
   playerUser.setEmailNotification(dto.getEmailNotification());
   dto.setMeetingPointNotification(playerUser.getMeetingPointNotification());
   dto.setPushBulletApiKey(playerUser.getPushBulletApiKey());
   return playerUser;
 }
Example #2
0
 public static void savePlayerUser(PlayerUserDto playerUserDto, String player) {
   PlayerUser playerUser =
       ofy().load().type(PlayerUser.class).filter("player == ", player).first().now();
   if (playerUser == null) {
     playerUser = new PlayerUser();
     playerUser.setPlayer(player);
   }
   playerUser.setEmail(playerUserDto.getEmail());
   playerUser.setImageUrl(playerUserDto.getImageUrl());
   playerUser.setEmailNotification(playerUserDto.getEmailNotification());
   playerUser.setMeetingPointNotification(playerUserDto.getMeetingPointNotification());
   playerUser.setPushBulletApiKey(playerUserDto.getPushBulletApiKey());
   ofy().save().entities(playerUser).now();
 }