コード例 #1
0
  private void translate(String body) throws MissingValueException {
    AuctionEvent event = AuctionEvent.from(body);

    String type = event.type();
    if ("CLOSE".equals(type)) {
      listener.auctionClosed();
    } else if ("PRICE".equals(type)) {
      listener.currentPrice(event.currentPrice(), event.increment(), event.isFrom(sniperId));
    }
  }
コード例 #2
0
 @Override
 public void processMessage(Chat chat, Message message) {
   try {
     translate(message.getBody());
   } catch (Exception parseException) {
     listener.auctionFailed();
   }
 }