Codota Logo
InternetDomainName.hasParent
Code IndexAdd Codota 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)

  • Common ways to obtain InternetDomainName
private void myMethod () {
InternetDomainName i =
  • Codota IconString domain;InternetDomainName.from(domain)
  • Codota IconPreconditions preconditions;Object reference;new InternetDomainName(preconditions.checkNotNull(reference))
  • Smart code suggestions by Codota
}
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

  • Making http requests using okhttp
  • getSupportFragmentManager (FragmentActivity)
  • getResourceAsStream (ClassLoader)
    Returns a stream for the resource with the specified name. See #getResource(String) for a descriptio
  • getExternalFilesDir (Context)
  • InputStream (java.io)
    A readable source of bytes.Most clients will use input streams that read data from the file system (
  • ResultSet (java.sql)
    An interface for an object which represents a database table entry, returned as the result of the qu
  • Timestamp (java.sql)
    A Java representation of the SQL TIMESTAMP type. It provides the capability of representing the SQL
  • HttpServlet (javax.servlet.http)
    Provides an abstract class to be subclassed to create an HTTP servlet suitable for a Web site. A sub
  • JTable (javax.swing)
  • IOUtils (org.apache.commons.io)
    General IO stream manipulation utilities. This class provides static utility methods for input/outpu
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now