List of usage examples for java.util Objects isNull
public static boolean isNull(Object obj)
From source file:com.mac.holdempoker.app.hands.Straight.java
@Override public void haveCard(Card card) { if (insertSize == 7 || Objects.isNull(card)) { return;/*from w w w .j ava2 s. c om*/ } cards[card.getRank().value() - 1] = card; if (card.getRank() == Rank.ACE) { cards[0] = card; } insertSize++; }
From source file:com.mac.holdempoker.app.impl.SimplePot.java
@Override public void newRound(RoundType roundType) { SinglePot sp = pot.get(roundType);/*w ww. ja va 2 s. c o m*/ if (Objects.isNull(sp)) { SinglePot newPot = new SinglePot(roundType); pot.put(roundType, newPot); currentPot = newPot; } }
From source file:com.mac.holdempoker.app.hands.Boat.java
@Override public void haveCard(Card card) { if (insertSize == 7) { return;/* w w w . j a v a2s. c om*/ } Card[] ranked = cards.get(card.getRank()); if (Objects.isNull(ranked)) { ranked = new Card[4]; cards.put(card.getRank(), ranked); } insert(ranked, card); insertSize++; }
From source file:com.mac.holdempoker.socket.SocketManager.java
public boolean addConnection(String pid, WebSocket conn) { System.out.println("pid: " + pid); System.out.println("conn: " + conn); if (isValidString(pid) && isValidObject(conn)) { System.out.println("Adding socket"); WebSocket old = connections.putIfAbsent(pid, conn); System.out.println("old socket: " + old); return Objects.isNull(old); }/*from ww w . j a v a2s . c o m*/ return false; }
From source file:com.mac.holdempoker.app.hands.Pair.java
@Override public void haveCard(Card card) { if (insertSize == 7) { return;/*from w ww .j a v a2 s . com*/ } List<Card> ranked = cards.get(card.getRank()); if (Objects.isNull(ranked)) { ranked = new ArrayList(); cards.put(card.getRank(), ranked); } ranked.add(card); Collections.sort(ranked, cardComparator()); insertSize++; }
From source file:com.mac.holdempoker.app.hands.Quad.java
@Override public void haveCard(Card card) { if (insertSize == 7) { return;//from www. j a v a 2 s . c o m } Card[] ranked = cards.get(card.getRank()); if (Objects.isNull(ranked)) { ranked = new Card[4]; cards.put(card.getRank(), ranked); } insert(ranked, card); Arrays.sort(ranked, cardComparator()); insertSize++; }
From source file:org.kisoonlineapp.uc.view.KostenView.java
public String formatKosten(Kosten kosten) { final StringBuilder sb = new StringBuilder(); BigDecimal kostenWert = null; String kostenHinweisText = null; if (kosten != null) { if (kosten.getBetragEuro() != null) { kostenWert = kosten.getBetragEuro(); }/*from www . j ava 2s . c o m*/ if (StringUtils.isNotBlank(kosten.getHinweis())) { kostenHinweisText = kosten.getHinweis(); } } //--- if (Objects.nonNull(kostenWert) && Objects.nonNull(kostenHinweisText)) { sb.append(messageResolver.retrieveMessageFor("kostenKostenHinweis", kostenWert, kostenHinweisText)); } else if (Objects.nonNull(kostenWert) && Objects.isNull(kostenHinweisText)) { sb.append(messageResolver.retrieveMessageFor("kostenKosten", kostenWert)); } else if (Objects.isNull(kostenWert) && Objects.nonNull(kostenHinweisText)) { sb.append(messageResolver.retrieveMessageFor("kostenKeineKostenHinweis", kostenHinweisText)); } else { sb.append(messageResolver.retrieveMessageFor("kostenKeineAngaben", kostenHinweisText)); } return sb.toString(); }
From source file:be.bittich.quote.vo.SecurityToken.java
@Override public boolean equals(Object obj) { if (Objects.isNull(obj) || !(obj instanceof SecurityToken)) { return false; }//from w ww . j av a 2 s .co m SecurityToken tk = (SecurityToken) obj; return (Objects.equals(this.getKey(), tk.getKey()) && Objects.equals(this.getExtendedInformation(), tk.getExtendedInformation()) && Objects.equals(this.getKeyCreationTime(), this.getKeyCreationTime())); }
From source file:pe.chalk.telegram.type.Response.java
public Object getResult() { if (!this.isOk() || Objects.isNull(this.result)) throw new IllegalStateException(this.getErrorCode() + ": " + this.getDescription()); return this.result; }
From source file:com.mac.holdempoker.app.hands.Straight.java
private boolean isStraight(Card[] strt) { if (Objects.isNull(strt)) { return false; }/*from w ww . j a v a 2s . c om*/ for (Card c : strt) { if (Objects.isNull(c)) { return false; } } return true; }