Package testModels

Source Code of testModels.SoccerMatchBuilder

package testModels;

import match.aggregate.Match;
import match.player.PlayerModel;
import match.player.PlayerState;

import java.util.HashSet;
import java.util.Set;
import java.util.UUID;

public class SoccerMatchBuilder {
    private SoccerMatchBuilder() {
    }

    public static SoccerMatchModel build() {
        Set<PlayerModel> players = new HashSet<PlayerModel>();
        UUID matchId = UUID.randomUUID();

        players.add(new PlayerModel(UUID.randomUUID(), "piet", PlayerState.playing));
        players.add(new PlayerModel(UUID.randomUUID(), "klaas", PlayerState.playing));
        players.add(new PlayerModel(UUID.randomUUID(), "frank", PlayerState.playing));
        players.add(new PlayerModel(UUID.randomUUID(), "henk", PlayerState.playing));

        Match match = new Match(matchId, players);

        return new SoccerMatchModel(players, match);
    }
}
TOP

Related Classes of testModels.SoccerMatchBuilder

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.