public boolean containsKey( long key ) { synchronized( mutex ) { return m.containsKey( key ); } } public boolean containsValue( Object value ){
public boolean containsKey( long key ) { return m.containsKey( key ); } public boolean containsValue( Object val ) { return m.containsValue( val ); }
/** * Checks for the present of <tt>key</tt> in the keys of the map. * * @param key an <code>Object</code> value * @return a <code>boolean</code> value */ public boolean containsKey( Object key ) { if ( key == null ) return _map.containsKey( _map.getNoEntryKey() ); return key instanceof Long && _map.containsKey( ( ( Long ) key ).longValue() ); }
public void add(RouteDataObject ro) { tileStatistics.addObject(ro); for (int i = 0; i < ro.pointsX.length; i++) { int x31 = ro.getPoint31XTile(i); int y31 = ro.getPoint31YTile(i); long l = (((long) x31) << 31) + (long) y31; RouteSegment segment = new RouteSegment(ro, i); if (!routes.containsKey(l)) { routes.put(l, segment); } else { RouteSegment orig = routes.get(l); while (orig.next != null) { orig = orig.next; } orig.next = segment; } } }
/** {@inheritDoc} */ public boolean equals( Object other ) { if ( ! ( other instanceof TLongObjectMap ) ) { return false; } TLongObjectMap that = ( TLongObjectMap ) other; if ( that.size() != this.size() ) { return false; } try { TLongObjectIterator iter = this.iterator(); while ( iter.hasNext() ) { iter.advance(); long key = iter.key(); Object value = iter.value(); if ( value == null ) { if ( !( that.get( key ) == null && that.containsKey( key ) ) ) { return false; } } else { if ( !value.equals( that.get( key ) ) ) { return false; } } } } catch ( ClassCastException ex ) { // unused. } return true; }
public boolean isLocked(long id) { return setupNodes.containsKey(id); }
public boolean containsMember(long userId) { if (members == null || members.isEmpty()) return false; return members.containsKey(userId); }
@Override public boolean isMember(User user) { return memberCache.getMap().containsKey(user.getIdLong()); }
@Override public PermissionOverrideAction createPermissionOverride(Role role) { Checks.notNull(role, "role"); if (overrides.containsKey(role.getIdLong())) throw new IllegalStateException("Provided role already has a PermissionOverride in this channel!"); return putPermissionOverride(role); }
@Override public PermissionOverrideAction createPermissionOverride(Member member) { Checks.notNull(member, "member"); if (overrides.containsKey(member.getUser().getIdLong())) throw new IllegalStateException("Provided member already has a PermissionOverride in this channel!"); return putPermissionOverride(member); }
/** * Returns true if the map contains the key. * @param key The key to check in the map. * @return true if the key is in the map. */ public final boolean containsKey(long key) { return map.containsKey(key); }
@SuppressWarnings("NumericCastThatLosesPrecision") @Override public boolean hasBody(long id) { return id >= 0L && id <= MAX_FAST_BODY_ID ? fastBodies[(int) id] != null : bodyById.containsKey(id); }
public SelfUser createSelfUser(JSONObject self) { SelfUserImpl selfUser = ((SelfUserImpl) getJDA().getSelfUser()); if (selfUser == null) { final long id = self.getLong("id"); selfUser = new SelfUserImpl(id, getJDA()); getJDA().setSelfUser(selfUser); } if (!getJDA().getUserMap().containsKey(selfUser.getIdLong())) getJDA().getUserMap().put(selfUser.getIdLong(), selfUser); selfUser.setVerified(self.getBoolean("verified")) .setMfaEnabled(self.getBoolean("mfa_enabled")) .setName(self.getString("username")) .setDiscriminator(self.getString("discriminator")) .setAvatarId(self.optString("avatar", null)) .setBot(Helpers.optBoolean(self, "bot")); if (this.getJDA().getAccountType() == AccountType.CLIENT) { selfUser .setEmail(self.optString("email", null)) .setMobile(Helpers.optBoolean(self, "mobile")) .setNitro(Helpers.optBoolean(self, "premium")) .setPhoneNumber(self.optString("phone", null)); } return selfUser; }
@Override public boolean containsKey( long key ) { synchronized( mutex ) { return m.containsKey( key ); } } @Override
public boolean containsKey( long key ) { synchronized( mutex ) { return m.containsKey( key ); } } public boolean containsValue( Object value ){
/** * Checks for the present of <tt>key</tt> in the keys of the map. * * @param key an <code>Object</code> value * @return a <code>boolean</code> value */ @Override public boolean containsKey( Object key ) { return key instanceof Long && _map.containsKey( ( ( Long ) key ).longValue() ); }
/** * Checks for the present of <tt>key</tt> in the keys of the map. * * @param key an <code>Object</code> value * @return a <code>boolean</code> value */ public boolean containsKey( Object key ) { if ( key == null ) return _map.containsKey( _map.getNoEntryKey() ); return key instanceof Long && _map.containsKey( ( ( Long ) key ).longValue() ); }
/** * Checks for the present of <tt>key</tt> in the keys of the map. * * @param key an <code>Object</code> value * @return a <code>boolean</code> value */ public boolean containsKey( Object key ) { if ( key == null ) return _map.containsKey( _map.getNoEntryKey() ); return key instanceof Long && _map.containsKey( ( ( Long ) key ).longValue() ); }
if (getJDA().getGuildMap().valueCollection().stream().noneMatch(g -> ((GuildImpl) g).getMembersMap().containsKey(userId)))
&& getJDA().getGuildMap().valueCollection().stream().noneMatch(g -> ((GuildImpl) g).getMembersMap().containsKey(userId)) && !(getJDA().getAccountType() == AccountType.CLIENT && getJDA().asClient().getFriendById(userId) != null))