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

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

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

origin: google/guava

public void testParentChild() {
 InternetDomainName origin = InternetDomainName.from("foo.com");
 InternetDomainName parent = origin.parent();
 assertEquals("com", parent.toString());
 // These would throw an exception if leniency were not preserved during parent() and child()
 // calls.
 InternetDomainName child = parent.child(LOTS_OF_DELTAS);
 child.child(LOTS_OF_DELTAS);
}
origin: google/guava

public void testChild() {
 InternetDomainName domain = InternetDomainName.from("foo.com");
 assertEquals("www.foo.com", domain.child("www").toString());
 try {
  domain.child("www.");
  fail("www..google.com should have been invalid");
 } catch (IllegalArgumentException expected) {
 }
}
origin: google/guava

public void testValidTopPrivateDomain() {
 InternetDomainName googleDomain = InternetDomainName.from("google.com");
 assertEquals(googleDomain, googleDomain.topPrivateDomain());
 assertEquals(googleDomain, googleDomain.child("mail").topPrivateDomain());
 assertEquals(googleDomain, googleDomain.child("foo.bar").topPrivateDomain());
}
origin: jclouds/legacy-jclouds

  @Override
  @SuppressWarnings("unchecked")
  public <R extends HttpRequest> R bindToRequest(R request, Object payload) {
   checkNotNull(payload, "hostprefix");
   checkArgument(isValid(request.getEndpoint().getHost()), "this is only valid for hostnames: " + request);
   InternetDomainName name = from(request.getEndpoint().getHost()).child(payload.toString());
   return (R) request.toBuilder().endpoint(uriBuilder(request.getEndpoint()).host(name.name()).build()).build();
  }
}
origin: com.amysta.jclouds/jclouds-core

  @Override
  @SuppressWarnings("unchecked")
  public <R extends HttpRequest> R bindToRequest(R request, Object payload) {
   checkNotNull(payload, "hostprefix");
   checkArgument(isValid(request.getEndpoint().getHost()), "this is only valid for hostnames: " + request);
   InternetDomainName name = from(request.getEndpoint().getHost()).child(payload.toString());
   URI newEndpoint = uriBuilder(request.getEndpoint()).host(name.toString()).build();
   return (R) request.toBuilder().endpoint(newEndpoint).replacePath(request.getEndpoint().getRawPath()).build();
  }
}
origin: org.jclouds/jclouds-core

  @Override
  @SuppressWarnings("unchecked")
  public <R extends HttpRequest> R bindToRequest(R request, Object payload) {
   checkNotNull(payload, "hostprefix");
   checkArgument(isValid(request.getEndpoint().getHost()), "this is only valid for hostnames: " + request);
   InternetDomainName name = from(request.getEndpoint().getHost()).child(payload.toString());
   return (R) request.toBuilder().endpoint(uriBuilder(request.getEndpoint()).host(name.name()).build()).build();
  }
}
origin: io.cloudsoft.jclouds/jclouds-core

  @Override
  @SuppressWarnings("unchecked")
  public <R extends HttpRequest> R bindToRequest(R request, Object payload) {
   checkNotNull(payload, "hostprefix");
   checkArgument(isValid(request.getEndpoint().getHost()), "this is only valid for hostnames: " + request);
   InternetDomainName name = from(request.getEndpoint().getHost()).child(payload.toString());
   return (R) request.toBuilder().endpoint(uriBuilder(request.getEndpoint()).host(name.toString()).build()).build();
  }
}
origin: Nextdoor/bender

  @Override
  @SuppressWarnings("unchecked")
  public <R extends HttpRequest> R bindToRequest(R request, Object payload) {
   checkNotNull(payload, "hostprefix");
   checkArgument(isValid(request.getEndpoint().getHost()), "this is only valid for hostnames: " + request);
   InternetDomainName name = from(request.getEndpoint().getHost()).child(payload.toString());
   URI newEndpoint = uriBuilder(request.getEndpoint()).host(name.toString()).build();
   return (R) request.toBuilder().endpoint(newEndpoint).replacePath(request.getEndpoint().getRawPath()).build();
  }
}
origin: apache/jclouds

  @Override
  @SuppressWarnings("unchecked")
  public <R extends HttpRequest> R bindToRequest(R request, Object payload) {
   checkNotNull(payload, "hostprefix");
   checkArgument(isValid(request.getEndpoint().getHost()), "this is only valid for hostnames: " + request);
   InternetDomainName name = from(request.getEndpoint().getHost()).child(payload.toString());
   URI newEndpoint = uriBuilder(request.getEndpoint()).host(name.toString()).build();
   return (R) request.toBuilder().endpoint(newEndpoint).replacePath(request.getEndpoint().getRawPath()).build();
  }
}
origin: com.google.guava/guava-tests

public void testChild() {
 InternetDomainName domain = InternetDomainName.from("foo.com");
 assertEquals("www.foo.com", domain.child("www").toString());
 try {
  domain.child("www.");
  fail("www..google.com should have been invalid");
 } catch (IllegalArgumentException expected) {
 }
}
origin: com.google.guava/guava-tests

public void testParentChild() {
 InternetDomainName origin = InternetDomainName.from("foo.com");
 InternetDomainName parent = origin.parent();
 assertEquals("com", parent.toString());
 // These would throw an exception if leniency were not preserved during parent() and child()
 // calls.
 InternetDomainName child = parent.child(LOTS_OF_DELTAS);
 child.child(LOTS_OF_DELTAS);
}
origin: com.google.guava/guava-tests

public void testValidTopPrivateDomain() {
 InternetDomainName googleDomain = InternetDomainName.from("google.com");
 assertEquals(googleDomain, googleDomain.topPrivateDomain());
 assertEquals(googleDomain, googleDomain.child("mail").topPrivateDomain());
 assertEquals(googleDomain, googleDomain.child("foo.bar").topPrivateDomain());
}
com.google.common.netInternetDomainNamechild

Javadoc

Creates and returns a new InternetDomainName by prepending the argument and a dot to the current name. For example, InternetDomainName.from("foo.com").child("www.bar")returns a new InternetDomainName with the value www.bar.foo.com. Only lenient validation is performed, as described #from(String).

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

Popular in Java

  • Reading from database using SQL prepared statement
  • getSupportFragmentManager (FragmentActivity)
  • setRequestProperty (URLConnection)
  • setContentView (Activity)
  • System (java.lang)
    Provides access to system-related information and resources including standard input and output. Ena
  • SocketTimeoutException (java.net)
    This exception is thrown when a timeout expired on a socket read or accept operation.
  • Annotation (javassist.bytecode.annotation)
    The annotation structure.An instance of this class is returned bygetAnnotations() in AnnotationsAttr
  • Cipher (javax.crypto)
    This class provides access to implementations of cryptographic ciphers for encryption and decryption
  • Servlet (javax.servlet)
    Defines methods that all servlets must implement. A servlet is a small Java program that runs within
  • JCheckBox (javax.swing)
  • 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