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

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

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

origin: google/guava

/**
 * Returns the portion of this domain name that is one level beneath the {@linkplain
 * #isRegistrySuffix() registry suffix}. For example, for {@code x.adwords.google.co.uk} it
 * returns {@code google.co.uk}, since {@code co.uk} is a registry suffix. Similarly, for {@code
 * myblog.blogspot.com} it returns {@code blogspot.com}, since {@code com} is a registry suffix.
 *
 * <p>If {@link #isTopDomainUnderRegistrySuffix()} is true, the current domain name instance is
 * returned.
 *
 * <p><b>Warning:</b> This method should not be used to determine whether a domain is probably the
 * highest level for which cookies may be set. Use {@link #isTopPrivateDomain()} for that purpose.
 *
 * @throws IllegalStateException if this domain does not end with a registry suffix
 * @since 23.3
 */
public InternetDomainName topDomainUnderRegistrySuffix() {
 if (isTopDomainUnderRegistrySuffix()) {
  return this;
 }
 checkState(isUnderRegistrySuffix(), "Not under a registry suffix: %s", name);
 return ancestor(registrySuffixIndex - 1);
}
origin: google/j2objc

/**
 * Returns the portion of this domain name that is one level beneath the {@linkplain
 * #isRegistrySuffix() registry suffix}. For example, for {@code x.adwords.google.co.uk} it
 * returns {@code google.co.uk}, since {@code co.uk} is a registry suffix. Similarly, for {@code
 * myblog.blogspot.com} it returns {@code blogspot.com}, since {@code com} is a registry suffix.
 *
 * <p>If {@link #isTopDomainUnderRegistrySuffix()} is true, the current domain name instance is
 * returned.
 *
 * <p><b>Warning:</b> This method should not be used to determine whether a domain is probably the
 * highest level for which cookies may be set. Use {@link #isTopPrivateDomain()} for that purpose.
 *
 * @throws IllegalStateException if this domain does not end with a registry suffix
 * @since 23.3
 */
public InternetDomainName topDomainUnderRegistrySuffix() {
 if (isTopDomainUnderRegistrySuffix()) {
  return this;
 }
 checkState(isUnderRegistrySuffix(), "Not under a registry suffix: %s", name);
 return ancestor(registrySuffixIndex - 1);
}
origin: wildfly/wildfly

/**
 * Returns the portion of this domain name that is one level beneath the {@linkplain
 * #isRegistrySuffix() registry suffix}. For example, for {@code x.adwords.google.co.uk} it
 * returns {@code google.co.uk}, since {@code co.uk} is a registry suffix. Similarly, for {@code
 * myblog.blogspot.com} it returns {@code blogspot.com}, since {@code com} is a registry suffix.
 *
 * <p>If {@link #isTopDomainUnderRegistrySuffix()} is true, the current domain name instance is
 * returned.
 *
 * <p><b>Warning:</b> This method should not be used to determine whether a domain is probably the
 * highest level for which cookies may be set. Use {@link #isTopPrivateDomain()} for that purpose.
 *
 * @throws IllegalStateException if this domain does not end with a registry suffix
 * @since 23.3
 */
public InternetDomainName topDomainUnderRegistrySuffix() {
 if (isTopDomainUnderRegistrySuffix()) {
  return this;
 }
 checkState(isUnderRegistrySuffix(), "Not under a registry suffix: %s", name);
 return ancestor(registrySuffixIndex - 1);
}
origin: google/guava

public void testUnderRegistrySuffix() {
 for (String name : SOMEWHERE_UNDER_RS) {
  final InternetDomainName domain = InternetDomainName.from(name);
  assertFalse(name, domain.isRegistrySuffix());
  assertTrue(name, domain.hasRegistrySuffix());
  assertTrue(name, domain.isUnderRegistrySuffix());
 }
}
origin: google/guava

public void testUnderTopDomainUnderRegistrySuffix() {
 for (String name : UNDER_TOP_UNDER_REGISTRY_SUFFIX) {
  final InternetDomainName domain = InternetDomainName.from(name);
  assertFalse(name, domain.isRegistrySuffix());
  assertTrue(name, domain.hasRegistrySuffix());
  assertTrue(name, domain.isUnderRegistrySuffix());
  assertFalse(name, domain.isTopDomainUnderRegistrySuffix());
 }
}
origin: google/guava

public void testTopDomainUnderRegistrySuffix() {
 for (String name : TOP_UNDER_REGISTRY_SUFFIX) {
  final InternetDomainName domain = InternetDomainName.from(name);
  assertFalse(name, domain.isRegistrySuffix());
  assertTrue(name, domain.hasRegistrySuffix());
  assertTrue(name, domain.isUnderRegistrySuffix());
  assertTrue(name, domain.isTopDomainUnderRegistrySuffix());
  assertEquals(domain.parent(), domain.registrySuffix());
 }
}
origin: google/guava

public void testRegistrySuffix() {
 for (String name : RS) {
  final InternetDomainName domain = InternetDomainName.from(name);
  assertTrue(name, domain.isRegistrySuffix());
  assertTrue(name, domain.hasRegistrySuffix());
  assertFalse(name, domain.isUnderRegistrySuffix());
  assertFalse(name, domain.isTopDomainUnderRegistrySuffix());
  assertEquals(domain, domain.registrySuffix());
 }
 for (String name : NO_RS) {
  final InternetDomainName domain = InternetDomainName.from(name);
  assertFalse(name, domain.isRegistrySuffix());
  assertFalse(name, domain.hasRegistrySuffix());
  assertFalse(name, domain.isUnderRegistrySuffix());
  assertFalse(name, domain.isTopDomainUnderRegistrySuffix());
  assertNull(domain.registrySuffix());
 }
 for (String name : NON_RS) {
  final InternetDomainName domain = InternetDomainName.from(name);
  assertFalse(name, domain.isRegistrySuffix());
  assertTrue(name, domain.hasRegistrySuffix());
  assertTrue(name, domain.isUnderRegistrySuffix());
 }
}
origin: org.jboss.eap/wildfly-client-all

/**
 * Returns the portion of this domain name that is one level beneath the {@linkplain
 * #isRegistrySuffix() registry suffix}. For example, for {@code x.adwords.google.co.uk} it
 * returns {@code google.co.uk}, since {@code co.uk} is a registry suffix. Similarly, for {@code
 * myblog.blogspot.com} it returns {@code blogspot.com}, since {@code com} is a registry suffix.
 *
 * <p>If {@link #isTopDomainUnderRegistrySuffix()} is true, the current domain name instance is
 * returned.
 *
 * <p><b>Warning:</b> This method should not be used to determine whether a domain is probably the
 * highest level for which cookies may be set. Use {@link #isTopPrivateDomain()} for that purpose.
 *
 * @throws IllegalStateException if this domain does not end with a registry suffix
 * @since 23.3
 */
public InternetDomainName topDomainUnderRegistrySuffix() {
 if (isTopDomainUnderRegistrySuffix()) {
  return this;
 }
 checkState(isUnderRegistrySuffix(), "Not under a registry suffix: %s", name);
 return ancestor(registrySuffixIndex - 1);
}
origin: org.kill-bill.billing/killbill-platform-osgi-bundles-logger

/**
 * Returns the portion of this domain name that is one level beneath the {@linkplain
 * #isRegistrySuffix() registry suffix}. For example, for {@code x.adwords.google.co.uk} it
 * returns {@code google.co.uk}, since {@code co.uk} is a registry suffix. Similarly, for {@code
 * myblog.blogspot.com} it returns {@code blogspot.com}, since {@code com} is a registry suffix.
 *
 * <p>If {@link #isTopDomainUnderRegistrySuffix()} is true, the current domain name instance is
 * returned.
 *
 * <p><b>Warning:</b> This method should not be used to determine whether a domain is probably the
 * highest level for which cookies may be set. Use {@link #isTopPrivateDomain()} for that purpose.
 *
 * @throws IllegalStateException if this domain does not end with a registry suffix
 * @since 23.3
 */
public InternetDomainName topDomainUnderRegistrySuffix() {
 if (isTopDomainUnderRegistrySuffix()) {
  return this;
 }
 checkState(isUnderRegistrySuffix(), "Not under a registry suffix: %s", name);
 return ancestor(registrySuffixIndex - 1);
}
origin: com.google.guava/guava-tests

public void testUnderRegistrySuffix() {
 for (String name : SOMEWHERE_UNDER_RS) {
  final InternetDomainName domain = InternetDomainName.from(name);
  assertFalse(name, domain.isRegistrySuffix());
  assertTrue(name, domain.hasRegistrySuffix());
  assertTrue(name, domain.isUnderRegistrySuffix());
 }
}
origin: com.google.guava/guava-tests

public void testUnderTopDomainUnderRegistrySuffix() {
 for (String name : UNDER_TOP_UNDER_REGISTRY_SUFFIX) {
  final InternetDomainName domain = InternetDomainName.from(name);
  assertFalse(name, domain.isRegistrySuffix());
  assertTrue(name, domain.hasRegistrySuffix());
  assertTrue(name, domain.isUnderRegistrySuffix());
  assertFalse(name, domain.isTopDomainUnderRegistrySuffix());
 }
}
origin: com.google.guava/guava-tests

public void testTopDomainUnderRegistrySuffix() {
 for (String name : TOP_UNDER_REGISTRY_SUFFIX) {
  final InternetDomainName domain = InternetDomainName.from(name);
  assertFalse(name, domain.isRegistrySuffix());
  assertTrue(name, domain.hasRegistrySuffix());
  assertTrue(name, domain.isUnderRegistrySuffix());
  assertTrue(name, domain.isTopDomainUnderRegistrySuffix());
  assertEquals(domain.parent(), domain.registrySuffix());
 }
}
origin: com.google.guava/guava-tests

public void testRegistrySuffix() {
 for (String name : RS) {
  final InternetDomainName domain = InternetDomainName.from(name);
  assertTrue(name, domain.isRegistrySuffix());
  assertTrue(name, domain.hasRegistrySuffix());
  assertFalse(name, domain.isUnderRegistrySuffix());
  assertFalse(name, domain.isTopDomainUnderRegistrySuffix());
  assertEquals(domain, domain.registrySuffix());
 }
 for (String name : NO_RS) {
  final InternetDomainName domain = InternetDomainName.from(name);
  assertFalse(name, domain.isRegistrySuffix());
  assertFalse(name, domain.hasRegistrySuffix());
  assertFalse(name, domain.isUnderRegistrySuffix());
  assertFalse(name, domain.isTopDomainUnderRegistrySuffix());
  assertNull(domain.registrySuffix());
 }
 for (String name : NON_RS) {
  final InternetDomainName domain = InternetDomainName.from(name);
  assertFalse(name, domain.isRegistrySuffix());
  assertTrue(name, domain.hasRegistrySuffix());
  assertTrue(name, domain.isUnderRegistrySuffix());
 }
}
com.google.common.netInternetDomainNameisUnderRegistrySuffix

Javadoc

Indicates whether this domain name ends in a #isRegistrySuffix(), while not being a registry suffix itself. For example, returns true for www.google.com, foo.co.uk and blogspot.com, but not for com, co.uk, or google.invalid.

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
  • hasParent
    Indicates whether this domain is composed of two or more parts.
  • <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
  • validateSyntax,
  • topPrivateDomain,
  • name,
  • findPublicSuffix,
  • matchesWildcardPublicSuffix,
  • parts,
  • child,
  • hasRegistrySuffix,
  • isTopDomainUnderRegistrySuffix

Popular in Java

  • Finding current android device location
  • getSupportFragmentManager (FragmentActivity)
  • putExtra (Intent)
  • findViewById (Activity)
  • HttpServer (com.sun.net.httpserver)
    This class implements a simple HTTP server. A HttpServer is bound to an IP address and port number a
  • Thread (java.lang)
    A thread is a thread of execution in a program. The Java Virtual Machine allows an application to ha
  • Proxy (java.net)
    This class represents proxy server settings. A created instance of Proxy stores a type and an addres
  • ArrayList (java.util)
    ArrayList is an implementation of List, backed by an array. All optional operations including adding
  • Enumeration (java.util)
    A legacy iteration interface.New code should use Iterator instead. Iterator replaces the enumeration
  • Stack (java.util)
    Stack is a Last-In/First-Out(LIFO) data structure which represents a stack of objects. It enables u
  • Top 12 Jupyter Notebook extensions
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