Tabnine Logo
InternetDomainName.hasParent
Code IndexAdd Tabnine to your IDE (free)

How to use
hasParent
method
in
com.google.common.net.InternetDomainName

Best Java code snippets using com.google.common.net.InternetDomainName.hasParent (Showing top 20 results out of 315)

origin: google/guava

/**
 * Returns an {@code InternetDomainName} that is the immediate ancestor of this one; that is, the
 * current domain with the leftmost part removed. For example, the parent of {@code
 * www.google.com} is {@code google.com}.
 *
 * @throws IllegalStateException if the domain has no parent, as determined by {@link #hasParent}
 */
public InternetDomainName parent() {
 checkState(hasParent(), "Domain '%s' has no parent", name);
 return ancestor(1);
}
origin: google/j2objc

/**
 * Returns an {@code InternetDomainName} that is the immediate ancestor of this one; that is, the
 * current domain with the leftmost part removed. For example, the parent of {@code
 * www.google.com} is {@code google.com}.
 *
 * @throws IllegalStateException if the domain has no parent, as determined by {@link #hasParent}
 */
public InternetDomainName parent() {
 checkState(hasParent(), "Domain '%s' has no parent", name);
 return ancestor(1);
}
origin: wildfly/wildfly

/**
 * Returns an {@code InternetDomainName} that is the immediate ancestor of this one; that is, the
 * current domain with the leftmost part removed. For example, the parent of {@code
 * www.google.com} is {@code google.com}.
 *
 * @throws IllegalStateException if the domain has no parent, as determined by {@link #hasParent}
 */
public InternetDomainName parent() {
 checkState(hasParent(), "Domain '%s' has no parent", name);
 return ancestor(1);
}
origin: internetarchive/heritrix3

/**
 * Returns a {@link LimitedCookieStoreFacade} whose
 * {@link LimitedCookieStoreFacade#getCookies()} method returns only cookies
 * from {@code host} and its parent domains, if applicable.
 */
public CookieStore cookieStoreFor(String host) {
  CompositeCollection cookieCollection = new CompositeCollection();
  if (InternetDomainName.isValid(host)) {
    InternetDomainName domain = InternetDomainName.from(host);
    while (domain != null) {
      Collection<Cookie> subset = hostSubset(domain.toString());
      cookieCollection.addComposited(subset);
      if (domain.hasParent()) {
        domain = domain.parent();
      } else {
        domain = null;
      }
    }
  } else {
    Collection<Cookie> subset = hostSubset(host.toString());
    cookieCollection.addComposited(subset);
  }
  @SuppressWarnings("unchecked")
  List<Cookie> cookieList = new RestrictedCollectionWrappedList<Cookie>(cookieCollection);
  LimitedCookieStoreFacade store = new LimitedCookieStoreFacade(cookieList);
  return store;
}
origin: com.google.guava/guava-jdk5

/**
 * Returns an {@code InternetDomainName} that is the immediate ancestor of
 * this one; that is, the current domain with the leftmost part removed. For
 * example, the parent of {@code www.google.com} is {@code google.com}.
 *
 * @throws IllegalStateException if the domain has no parent, as determined
 *     by {@link #hasParent}
 */
public InternetDomainName parent() {
 checkState(hasParent(), "Domain '%s' has no parent", name);
 return ancestor(1);
}
origin: org.kill-bill.billing/killbill-osgi-bundles-jruby

/**
 * Returns an {@code InternetDomainName} that is the immediate ancestor of
 * this one; that is, the current domain with the leftmost part removed. For
 * example, the parent of {@code www.google.com} is {@code google.com}.
 *
 * @throws IllegalStateException if the domain has no parent, as determined
 *     by {@link #hasParent}
 */
public InternetDomainName parent() {
 checkState(hasParent(), "Domain '%s' has no parent", name);
 return ancestor(1);
}
origin: com.diffplug.guava/guava-parse

/**
 * Returns an {@code InternetDomainName} that is the immediate ancestor of
 * this one; that is, the current domain with the leftmost part removed. For
 * example, the parent of {@code www.google.com} is {@code google.com}.
 *
 * @throws IllegalStateException if the domain has no parent, as determined
 *     by {@link #hasParent}
 */
public InternetDomainName parent() {
  checkState(hasParent(), "Domain '%s' has no parent", name);
  return ancestor(1);
}
origin: org.jboss.eap/wildfly-client-all

/**
 * Returns an {@code InternetDomainName} that is the immediate ancestor of this one; that is, the
 * current domain with the leftmost part removed. For example, the parent of {@code
 * www.google.com} is {@code google.com}.
 *
 * @throws IllegalStateException if the domain has no parent, as determined by {@link #hasParent}
 */
public InternetDomainName parent() {
 checkState(hasParent(), "Domain '%s' has no parent", name);
 return ancestor(1);
}
origin: org.kill-bill.billing/killbill-platform-osgi-bundles-logger

/**
 * Returns an {@code InternetDomainName} that is the immediate ancestor of this one; that is, the
 * current domain with the leftmost part removed. For example, the parent of {@code
 * www.google.com} is {@code google.com}.
 *
 * @throws IllegalStateException if the domain has no parent, as determined by {@link #hasParent}
 */
public InternetDomainName parent() {
 checkState(hasParent(), "Domain '%s' has no parent", name);
 return ancestor(1);
}
origin: com.ning.billing/killbill-osgi-bundles-analytics

/**
 * Returns an {@code InternetDomainName} that is the immediate ancestor of
 * this one; that is, the current domain with the leftmost part removed. For
 * example, the parent of {@code www.google.com} is {@code google.com}.
 *
 * @throws IllegalStateException if the domain has no parent, as determined
 *     by {@link #hasParent}
 */
public InternetDomainName parent() {
 checkState(hasParent(), "Domain '%s' has no parent", name);
 return ancestor(1);
}
origin: Nextdoor/bender

/**
 * Returns an {@code InternetDomainName} that is the immediate ancestor of
 * this one; that is, the current domain with the leftmost part removed. For
 * example, the parent of {@code www.google.com} is {@code google.com}.
 *
 * @throws IllegalStateException if the domain has no parent, as determined
 *     by {@link #hasParent}
 */
public InternetDomainName parent() {
 checkState(hasParent(), "Domain '%s' has no parent", name);
 return ancestor(1);
}
origin: org.sonatype.sisu/sisu-guava

/**
 * Returns an {@code InternetDomainName} that is the immediate ancestor of
 * this one; that is, the current domain with the leftmost part removed. For
 * example, the parent of {@code www.google.com} is {@code google.com}.
 *
 * @throws IllegalStateException if the domain has no parent, as determined
 *     by {@link #hasParent}
 */
public InternetDomainName parent() {
 checkState(hasParent(), "Domain '%s' has no parent", name);
 return ancestor(1);
}
origin: com.atlassian.bundles/guava

/**
 * Returns an {@code InternetDomainName} that is the immediate ancestor of
 * this one; that is, the current domain with the leftmost part removed. For
 * example, the parent of {@code www.google.com} is {@code google.com}.
 *
 * @throws IllegalStateException if the domain has no parent, as determined
 *     by {@link #hasParent}
 */
public InternetDomainName parent() {
 checkState(hasParent(), "Domain '%s' has no parent", name);
 return ancestor(1);
}
origin: at.bestsolution.efxclipse.eclipse/com.google.guava

/**
 * Returns an {@code InternetDomainName} that is the immediate ancestor of
 * this one; that is, the current domain with the leftmost part removed. For
 * example, the parent of {@code www.google.com} is {@code google.com}.
 *
 * @throws IllegalStateException if the domain has no parent, as determined
 *     by {@link #hasParent}
 */
public InternetDomainName parent() {
 checkState(hasParent(), "Domain '%s' has no parent", name);
 return ancestor(1);
}
origin: org.hudsonci.lib.guava/guava

/**
 * Returns an {@code InternetDomainName} that is the immediate ancestor of
 * this one; that is, the current domain with the leftmost part removed. For
 * example, the parent of {@code www.google.com} is {@code google.com}.
 *
 * @throws IllegalStateException if the domain has no parent, as determined
 *     by {@link #hasParent}
 */
public InternetDomainName parent() {
 checkState(hasParent(), "Domain '%s' has no parent", name);
 return ancestor(1);
}
origin: com.ning.billing/killbill-osgi-bundles-jruby

/**
 * Returns an {@code InternetDomainName} that is the immediate ancestor of
 * this one; that is, the current domain with the leftmost part removed. For
 * example, the parent of {@code www.google.com} is {@code google.com}.
 *
 * @throws IllegalStateException if the domain has no parent, as determined
 *     by {@link #hasParent}
 */
public InternetDomainName parent() {
 checkState(hasParent(), "Domain '%s' has no parent", name);
 return ancestor(1);
}
origin: uk.bl.wa.discovery/warc-indexer

private static ImmutableList.Builder<String> parentLevels(InternetDomainName internetDomainName) {
  ImmutableList.Builder<String> levels;
  if(internetDomainName.hasParent()){
    levels = parentLevels(internetDomainName.parent());
  }
  else {
    levels = ImmutableList.builder();
  }
  levels.add(internetDomainName.toString());
  return levels;
}
origin: ukwa/webarchive-discovery

private static ImmutableList.Builder<String> parentLevels(InternetDomainName internetDomainName) {
  ImmutableList.Builder<String> levels;
  if(internetDomainName.hasParent()){
    levels = parentLevels(internetDomainName.parent());
  }
  else {
    levels = ImmutableList.builder();
  }
  levels.add(internetDomainName.toString());
  return levels;
}
origin: tcplugins/tcWebHooks

  @Override
  public GeneralisedWebAddress getGeneralisedHostName(URL url) {
    String host = url.getHost();
//        if (! url.getHost().contains(".")) {
//            return GeneralisedWebAddress.build(host, GeneralisedWebAddressType.HOST_ADDRESS);
//        } else 
    InetAddress ip = extractInetAddress(host);
    if (ip != null) {
      if (ip instanceof Inet4Address ) {
        return GeneralisedWebAddress.build(host.replaceFirst("\\d+$", ""), GeneralisedWebAddressType.IPV4_ADDRESS);
      } else if (ip instanceof Inet6Address) {
        return GeneralisedWebAddress.build(ip.getHostAddress(), GeneralisedWebAddressType.IPV6_ADDRESS);
      }
    } else if (InternetDomainName.isValid(host)) { 
      InternetDomainName domainName = InternetDomainName.from(host);
      if (domainName.isUnderPublicSuffix()) {
        return GeneralisedWebAddress.build(domainName.topPrivateDomain().toString(), GeneralisedWebAddressType.DOMAIN_NAME);
      } else if (domainName.hasParent()) {
        return GeneralisedWebAddress.build(domainName.parent().toString(), GeneralisedWebAddressType.DOMAIN_NAME);
      }
      return GeneralisedWebAddress.build(host, GeneralisedWebAddressType.HOST_ADDRESS);
    }
    
    return null;
  }
  
origin: org.archive.heritrix/heritrix-modules

/**
 * Returns a {@link LimitedCookieStoreFacade} whose
 * {@link LimitedCookieStoreFacade#getCookies()} method returns only cookies
 * from {@code host} and its parent domains, if applicable.
 */
public CookieStore cookieStoreFor(String host) {
  CompositeCollection cookieCollection = new CompositeCollection();
  if (InternetDomainName.isValid(host)) {
    InternetDomainName domain = InternetDomainName.from(host);
    while (domain != null) {
      Collection<Cookie> subset = hostSubset(domain.toString());
      cookieCollection.addComposited(subset);
      if (domain.hasParent()) {
        domain = domain.parent();
      } else {
        domain = null;
      }
    }
  } else {
    Collection<Cookie> subset = hostSubset(host.toString());
    cookieCollection.addComposited(subset);
  }
  @SuppressWarnings("unchecked")
  List<Cookie> cookieList = new RestrictedCollectionWrappedList<Cookie>(cookieCollection);
  LimitedCookieStoreFacade store = new LimitedCookieStoreFacade(cookieList);
  return store;
}
com.google.common.netInternetDomainNamehasParent

Javadoc

Indicates whether this domain is composed of two or more parts.

Popular methods of InternetDomainName

  • from
    Returns an instance of InternetDomainName after lenient validation. Specifically, validation against
  • toString
    Returns the domain name, normalized to all lower case.
  • hasPublicSuffix
    Indicates whether this domain name ends in a #isPublicSuffix(), including if it is a public suffix i
  • isValid
    Indicates whether the argument is a syntactically valid domain name using lenient validation. Specif
  • isUnderPublicSuffix
    Indicates whether this domain name ends in a #isPublicSuffix(), while not being a public suffix itse
  • isTopPrivateDomain
    Indicates whether this domain name is composed of exactly one subdomain component followed by a #isP
  • <init>
    Private constructor used to implement #ancestor(int). Argument parts are assumed to be valid, as the
  • ancestor
    Returns the ancestor of the current domain at the given number of levels "higher" (rightward) in the
  • validatePart
    Helper method for #validateSyntax(List). Validates that one part of a domain name is valid.
  • validateSyntax
    Validation method used by to ensure that the domain name is syntactically valid according to RFC 103
  • topPrivateDomain
    Returns the portion of this domain name that is one level beneath the public suffix. For example, fo
  • name
    Returns the domain name, normalized to all lower case.
  • topPrivateDomain,
  • name,
  • findPublicSuffix,
  • matchesWildcardPublicSuffix,
  • parts,
  • child,
  • hasRegistrySuffix,
  • isTopDomainUnderRegistrySuffix,
  • isUnderRegistrySuffix

Popular in Java

  • Creating JSON documents from java classes using gson
  • notifyDataSetChanged (ArrayAdapter)
  • getResourceAsStream (ClassLoader)
  • getApplicationContext (Context)
  • InputStream (java.io)
    A readable source of bytes.Most clients will use input streams that read data from the file system (
  • URI (java.net)
    A Uniform Resource Identifier that identifies an abstract or physical resource, as specified by RFC
  • UnknownHostException (java.net)
    Thrown when a hostname can not be resolved.
  • NumberFormat (java.text)
    The abstract base class for all number formats. This class provides the interface for formatting and
  • Date (java.util)
    A specific moment in time, with millisecond precision. Values typically come from System#currentTime
  • Location (org.springframework.beans.factory.parsing)
    Class that models an arbitrary location in a Resource.Typically used to track the location of proble
  • Best plugins for Eclipse
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now