Check if host matches the registered value.

@param registered the registered host
@param requested the requested host
@return true if they match
973295
protected boolean hostMatches(String registered, String requested) {
		if (matchSubdomains) {
			return registered.equals(requested) || requested.endsWith("." + registered);
		}
		return registered.equals(requested);
	}
154505
def _hostname_matches(self, hostname, entry):
        
        for h in entry.hostnames:
            if (
                h == hostname
                or h.startswith("|1|")
                and not hostname.startswith("|1|")
                and constant_time_bytes_eq(self.hash_host(hostname, h), h)
            ):
                return True
        return False
288916
public boolean isRegistry(BareJid jid) throws NoResponseException, XMPPErrorException, NotConnectedException, InterruptedException {
        Objects.requireNonNull(jid, "JID argument must not be null");
        // At some point 'usedRegistries' will also contain the registry returned by findRegistry(), but since this is
        // not the case from the beginning, we perform findRegistry().equals(jid) too.
        Jid registry = findRegistry();
        if (jid.equals(registry)) {
            return true;
        }
        if (usedRegistries.contains(jid)) {
            return true;
        }
        return false;
    }
1141608
public static boolean checkCallbackValid(final @NonNull RegisteredService registeredService, final String redirectUri) {
        val registeredServiceId = registeredService.getServiceId();
        LOGGER.debug("Found: [{}] vs redirectUri: [{}]", registeredService, redirectUri);
        if (!redirectUri.matches(registeredServiceId)) {
            LOGGER.error("Unsupported [{}]: [{}] does not match what is defined for registered service: [{}]. "
                    + "Service is considered unauthorized. Verify the service definition in the registry is correct "
                    + "and does in fact match the client [{}]",
                OAuth20Constants.REDIRECT_URI, redirectUri, registeredServiceId, redirectUri);
            return false;
        }
        return true;
    }
876450
public boolean matches(ApiRequest request) {
        String apiOrgId = request.getApiOrgId();
        String apiId = request.getApiId();
        String apiVersion = request.getApiVersion();
        return matches(apiOrgId, apiId, apiVersion);
    }
1327461
protected boolean hostsEqual(URL u1, URL u2) {
        // Android-changed: Don't compare the InetAddresses of the hosts.
        if (u1.getHost() != null && u2.getHost() != null)
            return u1.getHost().equalsIgnoreCase(u2.getHost());
         else
            return u1.getHost() == null && u2.getHost() == null;
    }
410754
public static boolean hasLiteralIPAddress(URI resource) {
        String host = resource.getHost();
        if ( host == null || host.isEmpty() ) {
            return false;
        }
        // basic check for a '.'-separated numeric string for now
        return host.matches("([0-9A-Fa-f]|\\.){4,16}");
    }
633107
protected boolean isMatch(IPListConfig config, String remoteAddr) {
        if (config.getIpList().contains(remoteAddr)) {
            return true;
        }
        try {
            String [] remoteAddrSplit = remoteAddr.split("\\."); //$NON-NLS-1$
            for (String ip : config.getIpList()) {
                String [] ipSplit = ip.split("\\."); //$NON-NLS-1$
                if (remoteAddrSplit.length == ipSplit.length) {
                    int numParts = ipSplit.length;
                    boolean matches = true;
                    for (int idx = 0; idx < numParts; idx++) {
                        if (ipSplit[idx].equals("*") || ipSplit[idx].equals(remoteAddrSplit[idx])) { //$NON-NLS-1$
                            // This component matches!
                        } else {
                            matches = false;
                            break;
                        }
                    }
                    if (matches) {
                        return true;
                    }
                }
            }
        } catch (Throwable t) {
            // eat it
        }
        return false;
    }
697598
public synchronized boolean containsId(int requestId)
   {		
		if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc, "containsId", ""+requestId);
	
      testReqIdTableEntry.requestId = requestId;
		boolean result = table.containsKey(testReqIdTableEntry);
		
		if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(this, tc, "containsId", ""+result);
      return result;
   }
37514
static boolean isInvalidLocalHost(String host) {
        return StringUtils.isBlank(host)
            || isAnyHost(host)
            || isLocalHost(host);
    }
550414
def is_valid_host(value):
    
    host_validators = validators.ipv4, validators.ipv6, validators.domain
    return any(f(value) for f in host_validators)
243872
public boolean matches(String method, String uri) {
        return matches(HttpMethod.from(method), uri);
    }
104091
static boolean isServerOrHostController(ImmutableManagementResourceRegistration resourceRegistration) {
        return resourceRegistration.getProcessType().isServer() || !ModelDescriptionConstants.PROFILE.equals(resourceRegistration.getPathAddress().getElement(0).getKey());
    }
558194
public synchronized boolean isAllowedHost(String host) {
    boolean isIncluded = includes.isEmpty() || includes.contains(host);
    boolean isExcluded = excludes.contains(host);
    return isIncluded && !isExcluded;
  }
246121
public static void ensureServiceAccessIsAllowed(final RegisteredService registeredService) {
        ensureServiceAccessIsAllowed(registeredService != null ? registeredService.getName() : StringUtils.EMPTY, registeredService);
    }
463342
def valid_host(host):
    
    for part in host.split("."):
        if not _valid_host_part.match(part):
            return False

    return True
1349225
public boolean isMatched(String value, Boolean defaultValue)
    {
        if (value == null)
            return false;

        if (_match != null) {
            for (int i = 0; i < _match.length; i++) {
                if (value.equals(_match[i]))
                    return true;
            }
        }
        else {
            // a provided default value will override the group
            if (defaultValue != null)
                return defaultValue.booleanValue();

            // if we have a singleton definition then use that
            if (_defaultSingleton)
                return _defaultSingleValue;

            // check to see if we have a default arraylist with the value in it
            if (_defaultSelections != null)
                return _defaultSelections.contains(value);
        }

        return false;
    }