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

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

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

origin: google/guava

/**
 * Returns the {@linkplain #isRegistrySuffix() registry suffix} portion of the domain name, or
 * {@code null} if no registry suffix is present.
 *
 * @since 23.3
 */
public InternetDomainName registrySuffix() {
 return hasRegistrySuffix() ? ancestor(registrySuffixIndex) : null;
}
origin: google/j2objc

/**
 * Returns the {@linkplain #isRegistrySuffix() registry suffix} portion of the domain name, or
 * {@code null} if no registry suffix is present.
 *
 * @since 23.3
 */
public InternetDomainName registrySuffix() {
 return hasRegistrySuffix() ? ancestor(registrySuffixIndex) : null;
}
origin: wildfly/wildfly

/**
 * Returns the {@linkplain #isRegistrySuffix() registry suffix} portion of the domain name, or
 * {@code null} if no registry suffix is present.
 *
 * @since 23.3
 */
public InternetDomainName registrySuffix() {
 return hasRegistrySuffix() ? ancestor(registrySuffixIndex) : null;
}
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 testRegistrySuffixExclusion() {
 InternetDomainName domain = InternetDomainName.from("foo.city.yokohama.jp");
 assertTrue(domain.hasRegistrySuffix());
 assertEquals("yokohama.jp", domain.registrySuffix().toString());
 // Behold the weirdness!
 assertFalse(domain.registrySuffix().isRegistrySuffix());
}
origin: google/guava

public void testRegistrySuffixMultipleUnders() {
 // PSL has both *.uk and *.sch.uk; the latter should win.
 // See http://code.google.com/p/guava-libraries/issues/detail?id=1176
 InternetDomainName domain = InternetDomainName.from("www.essex.sch.uk");
 assertTrue(domain.hasRegistrySuffix());
 assertEquals("essex.sch.uk", domain.registrySuffix().toString());
 assertEquals("www.essex.sch.uk", domain.topDomainUnderRegistrySuffix().toString());
}
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 {@linkplain #isRegistrySuffix() registry suffix} portion of the domain name, or
 * {@code null} if no registry suffix is present.
 *
 * @since 23.3
 */
public InternetDomainName registrySuffix() {
 return hasRegistrySuffix() ? ancestor(registrySuffixIndex) : null;
}
origin: org.kill-bill.billing/killbill-platform-osgi-bundles-logger

/**
 * Returns the {@linkplain #isRegistrySuffix() registry suffix} portion of the domain name, or
 * {@code null} if no registry suffix is present.
 *
 * @since 23.3
 */
public InternetDomainName registrySuffix() {
 return hasRegistrySuffix() ? ancestor(registrySuffixIndex) : null;
}
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 testRegistrySuffixExclusion() {
 InternetDomainName domain = InternetDomainName.from("foo.city.yokohama.jp");
 assertTrue(domain.hasRegistrySuffix());
 assertEquals("yokohama.jp", domain.registrySuffix().toString());
 // Behold the weirdness!
 assertFalse(domain.registrySuffix().isRegistrySuffix());
}
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 testRegistrySuffixMultipleUnders() {
 // PSL has both *.uk and *.sch.uk; the latter should win.
 // See http://code.google.com/p/guava-libraries/issues/detail?id=1176
 InternetDomainName domain = InternetDomainName.from("www.essex.sch.uk");
 assertTrue(domain.hasRegistrySuffix());
 assertEquals("essex.sch.uk", domain.registrySuffix().toString());
 assertEquals("www.essex.sch.uk", domain.topDomainUnderRegistrySuffix().toString());
}
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.netInternetDomainNamehasRegistrySuffix

Javadoc

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

Note that this method is equivalent to #hasPublicSuffix() because all registry suffixes are public suffixes and all public suffixes have registry suffixes.

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,
  • isTopDomainUnderRegistrySuffix,
  • isUnderRegistrySuffix

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
  • From CI to AI: The AI layer in your organization
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