Class ServiceURL.Builder

java.lang.Object
org.wildfly.discovery.ServiceURL.Builder
Enclosing class:
ServiceURL

public static class ServiceURL.Builder extends Object
A builder for service URLs.
  • Constructor Details

    • Builder

      public Builder()
      Construct a new instance.
    • Builder

      public Builder(ServiceURL original)
      Construct a new instance from an original template.
      Parameters:
      original - the original service URL (must not be null)
  • Method Details

    • getAbstractType

      public String getAbstractType()
      Get the abstract type.
      Returns:
      the abstract type, or null if it is not set
    • setAbstractType

      public ServiceURL.Builder setAbstractType(String abstractType)
      Set the abstract type.
      Parameters:
      abstractType - the abstract type
      Returns:
      this builder
    • getAbstractTypeAuthority

      public String getAbstractTypeAuthority()
      Get the abstract type authority.
      Returns:
      the abstract type authority, or null if it is not set
    • setAbstractTypeAuthority

      public ServiceURL.Builder setAbstractTypeAuthority(String abstractTypeAuthority)
      Set the abstract authority.
      Parameters:
      abstractTypeAuthority - the abstract authority
      Returns:
      this builder
    • getUri

      public URI getUri()
      Get the concrete URI.
      Returns:
      the concrete URI
    • setUri

      public ServiceURL.Builder setUri(URI uri)
      Set the concrete URI.
      Parameters:
      uri - the concrete URI (must not be null)
      Returns:
      this builder
    • getUriSchemeAuthority

      public String getUriSchemeAuthority()
      Get the URI scheme authority, if any.
      Returns:
      the URI scheme authority, or null if none is set
    • setUriSchemeAuthority

      public ServiceURL.Builder setUriSchemeAuthority(String uriSchemeAuthority)
      Set the URI scheme authority.
      Parameters:
      uriSchemeAuthority - the URI scheme authority
      Returns:
      this builder
    • addAttribute

      public ServiceURL.Builder addAttribute(String name, AttributeValue value)
      Add an attribute.
      Parameters:
      name - the attribute name (must not be null)
      value - the attribute value (must not be null)
      Returns:
      this builder
    • addAttribute

      public ServiceURL.Builder addAttribute(String name)
      Add a valueless attribute.
      Parameters:
      name - the attribute name (must not be null)
      Returns:
      this builder
    • removeAttribute

      public List<AttributeValue> removeAttribute(String name)
      Remove all values of the given attribute name.
      Parameters:
      name - the attribute name (must not be null)
      Returns:
      the removed attribute values, or null if the attribute was not present in the builder
    • removeAttributeValue

      public boolean removeAttributeValue(String name, AttributeValue value)
      Remove the given value of the given attribute name.
      Parameters:
      name - the attribute name (must not be null)
      value - the value to remove (must not be null)
      Returns:
      true if the value was present, or false otherwise
    • create

      public ServiceURL create()
      Construct the service URL.
      Returns:
      the service URL
      Throws:
      IllegalArgumentException - if one or more builder property values is not acceptable