|
|
@ -18,6 +18,7 @@ import org.bson.types.ObjectId;
|
|
|
|
import java.time.ZoneId;
|
|
|
|
import java.time.ZoneId;
|
|
|
|
import java.util.Date;
|
|
|
|
import java.util.Date;
|
|
|
|
import java.util.List;
|
|
|
|
import java.util.List;
|
|
|
|
|
|
|
|
import java.util.Set;
|
|
|
|
import java.util.stream.Collectors;
|
|
|
|
import java.util.stream.Collectors;
|
|
|
|
|
|
|
|
|
|
|
|
public class PokemongCodec extends GenericCodec<Pokemong> {
|
|
|
|
public class PokemongCodec extends GenericCodec<Pokemong> {
|
|
|
@ -133,15 +134,15 @@ public class PokemongCodec extends GenericCodec<Pokemong> {
|
|
|
|
.collect(Collectors.toList());
|
|
|
|
.collect(Collectors.toList());
|
|
|
|
pokemong.setTypes(types);
|
|
|
|
pokemong.setTypes(types);
|
|
|
|
|
|
|
|
|
|
|
|
List<PokemongMove> moveSet = document.getList("moveSet", Document.class)
|
|
|
|
Set<PokemongMove> moveSet = document.getList("moveSet", Document.class)
|
|
|
|
.stream()
|
|
|
|
.stream()
|
|
|
|
.map(pokemongMoveDoc -> {
|
|
|
|
.map(pokemongMoveDoc -> {
|
|
|
|
PokemongMove move = new PokemongMove();
|
|
|
|
PokemongMove move = new PokemongMove();
|
|
|
|
move.setId(((ObjectId) pokemongMoveDoc.get("_id")).toString());
|
|
|
|
move.setId(((ObjectId) pokemongMoveDoc.get("_id")).toString());
|
|
|
|
move.setName(pokemongMoveDoc.getString("name"));
|
|
|
|
move.setName(pokemongMoveDoc.getString("name"));
|
|
|
|
return move;
|
|
|
|
return move;
|
|
|
|
})
|
|
|
|
})
|
|
|
|
.collect(Collectors.toList());
|
|
|
|
.collect(Collectors.toSet());
|
|
|
|
pokemong.setMoveSet(moveSet);
|
|
|
|
pokemong.setMoveSet(moveSet);
|
|
|
|
|
|
|
|
|
|
|
|
return pokemong;
|
|
|
|
return pokemong;
|
|
|
|