Package com.ngrok

Class MetadataBuilder<T extends MetadataBuilder>

  • Type Parameters:
    T - the concrete builder impl to return to satisfy the builder pattern
    Direct Known Subclasses:
    EdgeBuilder, EndpointBuilder

    public abstract class MetadataBuilder<T extends MetadataBuilder>
    extends Object
    An abstract builder sharing common attributes of all listener builders.
    • Constructor Detail

      • MetadataBuilder

        public MetadataBuilder()
    • Method Detail

      • metadata

        public T metadata​(String metadata)
        Sets the metadata for this endpoint.
        Parameters:
        metadata - the metadata
        Returns:
        An instance the builder represented by type T
      • forwardsTo

        public T forwardsTo​(String forwardsTo)
        Sets the forwarding information for this endpoint. If you need to automatically forward connections, you can use Forwarder, either through using Forwarder.Builder or directly calling methods on Session such as Session.forwardHttp(HttpBuilder, URL). NOTE: Using the Forwarder will override what is set here with the actual URL you're forwarding to.
        Parameters:
        forwardsTo - the forwarding information
        Returns:
        An instance the builder represented by type T
      • getMetadata

        public Optional<String> getMetadata()
        Returns the metadata for this endpoint.
        Returns:
        the metadata
      • getForwardsTo

        public Optional<String> getForwardsTo()
        Returns the forwarding information for this endpoint.
        Returns:
        the forwarding information