/* (non-Javadoc)
@see org.esupportail.smsuapi.dao.DaoService#isPhoneNumberInBlackList(java.lang.String)
495483
public boolean isPhoneNumberInBlackList(final String phoneNumber) {
		final Criteria criteria = getCurrentSession().createCriteria(Blacklist.class);
		criteria.add(Restrictions.eq(Blacklist.PROP_BLA_PHONE, phoneNumber));
		return criteria.uniqueResult() != null;
	}
1038589
public static boolean isBlank(final Collection<String> c) {
        if (c == null || c.isEmpty()) {
            return false;
        }
        for (final String text : c) {
            if (isNotBlank(text)) {
                return false;
            }
        }
        return true;
    }
1037494
public static boolean isAnyBlank(String... values) {
        if (CollectionKit.isEmpty(values)) {
            return true;
        }
        return Stream.of(values).filter(StringKit::isBlank).count() == values.length;
    }
434551
public static function isValidPhoneNumber($phoneNumber)
    {
        /*
         * Not a string?
         * Nothing to do
         */
        if (!is_string($phoneNumber)) {
            return false;
        }

        $pattern = self::getPhoneNumberPattern();

        return (bool)preg_match($pattern, trim($phoneNumber));
    }
729167
public boolean isBlackBerry() {
		if(!isBlackBerryDone) {
			String agent = req.getHeader("user-agent");
			isBlackBerry=agent != null && agent.startsWith("BlackBerry");
			isBlackBerryDone=true;
		}
		return isBlackBerry;
	}
383974
private void putPhoneNumberInBlackList(final String phoneNumber, final Application application ) {
		// if phone number is not already in the bl (it should not append) put the phone number
		// put the phone number in the black list
        if (daoService.isPhoneNumberInBlackList(phoneNumber)) return;
				logger.debug("Adding to black list : \n" + 
					     " - Phone number : " + phoneNumber + "\n" + 
					     " - Application id : " + application.getId() + "\n");
			
			final Date currentDate = new Date(System.currentTimeMillis());
			daoService.addBlacklist(new Blacklist(application, currentDate, phoneNumber));
	}
1175520
@Override
    final public boolean isCallerInRole(String roleName) {
        final boolean isTraceOn = TraceComponent.isAnyTracingEnabled();
        if (isTraceOn && tc.isEntryEnabled()) {
            Tr.entry(tc, "isCallerInRole, role = " + roleName + ", state = " + StateStrs[state]);
        }

        if (state == METHOD_READY) // d571981
        {
            boolean inRole = super.isCallerInRole(roleName, ivEjbInstance);
            if (isTraceOn && tc.isEntryEnabled()) {
                Tr.exit(tc, "isCallerInRole: " + inRole);
            }
            return inRole;
        } else {
            throw new IllegalStateException("For Singleton, isCallerInRole only allowed while in METHOD_READY state");
        }
    }
1312335
public static boolean isNumber( Class clazz ) {
      return clazz != null
            && (Byte.TYPE.isAssignableFrom( clazz ) || Short.TYPE.isAssignableFrom( clazz )
                  || Integer.TYPE.isAssignableFrom( clazz ) || Long.TYPE.isAssignableFrom( clazz )
                  || Float.TYPE.isAssignableFrom( clazz ) || Double.TYPE.isAssignableFrom( clazz ) || Number.class.isAssignableFrom( clazz ));
   }
241100
public void setServiceCodeList(java.util.Collection<String> serviceCodeList) {
        if (serviceCodeList == null) {
            this.serviceCodeList = null;
            return;
        }

        this.serviceCodeList = new com.amazonaws.internal.SdkInternalList<String>(serviceCodeList);
    }
876113
@SuppressWarnings("unused")
    public boolean isValid() {
        Phonenumber.PhoneNumber phoneNumber = getPhoneNumber();
        return phoneNumber != null && mPhoneUtil.isValidNumber(phoneNumber);
    }
638365
@Override
	public boolean isInAddressBook(String phoneNumber) {
		AndroidContact c = AndroidContact.lookupByNumber(phoneNumber);
		return c != null;
	}
122238
private function isIpBlacklisted()
    {
        $blacklist = $this->config->get('RateLimitBlacklist', [], true);
        if (in_array($this->ip, $blacklist)) {
            return true;
        }

        return false;
    }
668015
public boolean hasSlotIsNumber(final String slotName) {
        return hasSlot(slotName) && NumberUtils.isNumber(intentRequest.getIntent().getSlot(slotName).getValue());
    }
1332210
@Override
    public List<PhoneNumber> searchForNumbers(String country, PhoneNumberSearchFilters listFilters) {
        if(logger.isDebugEnabled()) {
            logger.debug("searchPattern " + listFilters.getFilterPattern());
        }
        String areaCode = listFilters.getAreaCode();
        Pattern filterPattern = listFilters.getFilterPattern();
        String searchPattern = null;
        if(filterPattern != null) {
            searchPattern = filterPattern.toString();
        }
        if ((areaCode == null || !areaCode.isEmpty() || areaCode.length() < 3) &&
                (searchPattern != null && !searchPattern.toString().isEmpty() && searchPattern.toString().length() >= 5)) {
            areaCode = searchPattern.toString().substring(2, 5);
            if(logger.isDebugEnabled()) {
                logger.debug("areaCode derived from searchPattern " + searchPattern);
            }
        }
        if (areaCode != null && !areaCode.isEmpty() && (areaCode.length() == 3)) {
            final StringBuilder buffer = new StringBuilder();
            buffer.append("<request id=\""+generateId()+"\">");
            buffer.append(header);
            buffer.append("<body>");
            buffer.append("<requesttype>").append("getDIDs").append("</requesttype>");
            buffer.append("<item>");
            buffer.append("<npa>").append(areaCode).append("</npa>");
            buffer.append("</item>");
            buffer.append("</body>");
            buffer.append("</request>");
            final String body = buffer.toString();
            final HttpPost post = new HttpPost(uri);

            List<NameValuePair> parameters = new ArrayList<NameValuePair>();
            parameters.add(new BasicNameValuePair("apidata", body));
            try {
                post.setEntity(new UrlEncodedFormEntity(parameters));

                final DefaultHttpClient client = new DefaultHttpClient();
                if (telestaxProxyEnabled) {
                    addTelestaxProxyHeaders(post, ProvisionProvider.REQUEST_TYPE.GETDIDS.name());
                }
                final HttpResponse response = client.execute(post);
                if (response.getStatusLine().getStatusCode() == HttpStatus.SC_OK) {
                    final String content = StringUtils.toString(response.getEntity().getContent());
                    final VoipInnovationsResponse result = (VoipInnovationsResponse) xstream.fromXML(content);
                    final GetDIDListResponse dids = (GetDIDListResponse) result.body().content();
                    if (dids.code() == 100) {
                        final List<PhoneNumber> numbers = toAvailablePhoneNumbers(dids, listFilters);
                        return numbers;
                    }
                } else {
                    logger.warn("Couldn't reach uri for getting DIDs. Response status was: "+response.getStatusLine().getStatusCode());
                }
            } catch (final Exception e) {
                logger.warn("Couldn't reach uri for getting DIDs " + uri, e);
            }
        }
        return new ArrayList<PhoneNumber>();
    }
725882
protected function isBlacklisted($uri, $referer, array $blacklistUrls)
    {
        foreach ($blacklistUrls as $blacklistUrl) {
            $pattern = '`' . $blacklistUrl . '`i';
            $match   = preg_match($pattern, $uri) + preg_match($pattern, $referer);

            if ($match > 0) {
                return true;
            }
        }

        return false;
    }
841014
public void addPhoneNumber(String newPhoneNumber) {
        if (newPhoneNumber==null || newPhoneNumber.trim().length()==0) {
            return;
        }

        if (phoneNumbers == null) {
            phoneNumbers = new ArrayList<>(1);
        }
        for (PhoneNumber phoneNumber : phoneNumbers) {
            if (phoneNumber.value.equals(newPhoneNumber) && phoneNumber.getType() == null) {
                throw new IllegalArgumentException("Already contains phoneNumber " + newPhoneNumber);
            }
        }

        PhoneNumber number = new PhoneNumber();
        number.setValue(newPhoneNumber);
        phoneNumbers.add(number);
    }
1176877
public static boolean isBlankJson(final Object obj) {
        if (obj == null) {
            return true;
        }
        if(obj instanceof Collection) {
            return (((Collection) obj).size() == 0);
        }
        if(obj instanceof Map) {
            return (((Map) obj).size() == 0);
        }
        throw new UnsupportedOperationException("map or list is supported, got ${obj?obj.getClass():null}");
    }