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
  • getSystemService (Context)
  • setContentView (Activity)
  • getApplicationContext (Context)
  • Window (java.awt)
    A Window object is a top-level window with no borders and no menubar. The default layout for a windo
  • OutputStream (java.io)
    A writable sink for bytes.Most clients will use output streams that write data to the file system (
  • BitSet (java.util)
    The BitSet class implements abit array [http://en.wikipedia.org/wiki/Bit_array]. Each element is eit
  • Random (java.util)
    This class provides methods that return pseudo-random values.It is dangerous to seed Random with the
  • Scanner (java.util)
    A parser that parses a text string of primitive types and strings with the help of regular expressio
  • Runner (org.openjdk.jmh.runner)
  • 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