Class ImmutableServiceQuery.Builder

  • Enclosing class:
    ImmutableServiceQuery

    @NotThreadSafe
    public static final class ImmutableServiceQuery.Builder
    extends java.lang.Object
    Builds instances of type ImmutableServiceQuery. Initialize attributes and then invoke the build() method to create an immutable instance.

    Builder is not thread-safe and generally should not be stored in a field or collection, but instead used immediately to create instances.

    • Method Detail

      • from

        @CanIgnoreReturnValue
        public final ImmutableServiceQuery.Builder from​(ServiceQuery instance)
        Fill a builder with attribute values from the provided ServiceQuery instance. Regular attribute values will be replaced with those from the given instance. Absent optional values will not replace present values.
        Parameters:
        instance - The instance from which to copy values
        Returns:
        this builder for use in a chained invocation
      • service

        @CanIgnoreReturnValue
        public final ImmutableServiceQuery.Builder service​(java.lang.String service)
        Initializes the value for the service attribute.
        Parameters:
        service - The value for service
        Returns:
        this builder for use in a chained invocation
      • onlyPassing

        @CanIgnoreReturnValue
        public final ImmutableServiceQuery.Builder onlyPassing​(boolean onlyPassing)
        Initializes the optional value onlyPassing to onlyPassing.
        Parameters:
        onlyPassing - The value for onlyPassing
        Returns:
        this builder for chained invocation
      • onlyPassing

        @CanIgnoreReturnValue
        public final ImmutableServiceQuery.Builder onlyPassing​(java.util.Optional<java.lang.Boolean> onlyPassing)
        Initializes the optional value onlyPassing to onlyPassing.
        Parameters:
        onlyPassing - The value for onlyPassing
        Returns:
        this builder for use in a chained invocation
      • tags

        @CanIgnoreReturnValue
        public final ImmutableServiceQuery.Builder tags​(java.util.List<java.lang.String> tags)
        Initializes the optional value tags to tags.
        Parameters:
        tags - The value for tags
        Returns:
        this builder for chained invocation
      • tags

        @CanIgnoreReturnValue
        public final ImmutableServiceQuery.Builder tags​(java.util.Optional<? extends java.util.List<java.lang.String>> tags)
        Initializes the optional value tags to tags.
        Parameters:
        tags - The value for tags
        Returns:
        this builder for use in a chained invocation
      • failover

        @CanIgnoreReturnValue
        public final ImmutableServiceQuery.Builder failover​(Failover failover)
        Initializes the optional value failover to failover.
        Parameters:
        failover - The value for failover
        Returns:
        this builder for chained invocation
      • failover

        @CanIgnoreReturnValue
        public final ImmutableServiceQuery.Builder failover​(java.util.Optional<? extends Failover> failover)
        Initializes the optional value failover to failover.
        Parameters:
        failover - The value for failover
        Returns:
        this builder for use in a chained invocation
      • build

        public ImmutableServiceQuery build()
        Builds a new ImmutableServiceQuery.
        Returns:
        An immutable instance of ServiceQuery
        Throws:
        java.lang.IllegalStateException - if any required attributes are missing