stubtournamentmatchmanager.java

来自「一些很有用的spring的书籍」· Java 代码 · 共 24 行

JAVA
24
字号
package com.apress.springbook.chapter01.test;

import com.apress.springbook.chapter01.TournamentMatchManager;
import com.apress.springbook.chapter01.Match;
import com.apress.springbook.chapter01.Player;
import com.apress.springbook.chapter01.UnknownMatchException;
import com.apress.springbook.chapter01.MatchIsFinishedException;
import com.apress.springbook.chapter01.PreviousMatchesNotFinishedException;
import com.apress.springbook.chapter01.MatchCannotBePlayedException;

public class StubTournamentMatchManager implements TournamentMatchManager {
  public Match startMatch(long matchId) throws
      UnknownMatchException, MatchIsFinishedException,
      PreviousMatchesNotFinishedException, MatchCannotBePlayedException {
    Player player1 = Player.femalePlayer ();
    player1.setName("Kim Clijsters");

    Player player2 = Player.femalePlayer();
    player2.setName("Justine Henin-Hardenne");

    return new Match(player1, player2);
  }
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?