Class ImmutableServiceCheck


  • @ParametersAreNonnullByDefault
    @Generated("org.immutables.processor.ProxyProcessor")
    @Immutable
    @CheckReturnValue
    public final class ImmutableServiceCheck
    extends ServiceCheck
    Immutable implementation of ServiceCheck.

    Use the builder to create immutable instances: ImmutableServiceCheck.builder().

    • Method Detail

      • getNode

        public Node getNode()
        Specified by:
        getNode in class ServiceCheck
        Returns:
        The value of the node attribute
      • getChecks

        public com.google.common.collect.ImmutableList<HealthCheck> getChecks()
        Specified by:
        getChecks in class ServiceCheck
        Returns:
        The value of the checks attribute
      • withNode

        public final ImmutableServiceCheck withNode​(Node value)
        Copy the current immutable object by setting a value for the node attribute. A shallow reference equality check is used to prevent copying of the same value by returning this.
        Parameters:
        value - A new value for node
        Returns:
        A modified copy of the this object
      • withService

        public final ImmutableServiceCheck withService​(Service value)
        Copy the current immutable object by setting a value for the service attribute. A shallow reference equality check is used to prevent copying of the same value by returning this.
        Parameters:
        value - A new value for service
        Returns:
        A modified copy of the this object
      • withChecks

        public final ImmutableServiceCheck withChecks​(HealthCheck... elements)
        Copy the current immutable object with elements that replace the content of checks.
        Parameters:
        elements - The elements to set
        Returns:
        A modified copy of this object
      • withChecks

        public final ImmutableServiceCheck withChecks​(java.lang.Iterable<? extends HealthCheck> elements)
        Copy the current immutable object with elements that replace the content of checks. A shallow reference equality check is used to prevent copying of the same value by returning this.
        Parameters:
        elements - An iterable of checks elements to set
        Returns:
        A modified copy of this object
      • equals

        public boolean equals​(@Nullable
                              java.lang.Object another)
        This instance is equal to all instances of ImmutableServiceCheck that have equal attribute values.
        Overrides:
        equals in class java.lang.Object
        Returns:
        true if this is equal to another instance
      • hashCode

        public int hashCode()
        Computes a hash code from attributes: node, service, checks.
        Overrides:
        hashCode in class java.lang.Object
        Returns:
        hashCode value
      • toString

        public java.lang.String toString()
        Prints the immutable value ServiceCheck with attribute values.
        Overrides:
        toString in class java.lang.Object
        Returns:
        A string representation of the value
      • copyOf

        public static ImmutableServiceCheck copyOf​(ServiceCheck instance)
        Creates an immutable copy of a ServiceCheck value. Uses accessors to get values to initialize the new immutable instance. If an instance is already immutable, it is returned as is.
        Parameters:
        instance - The instance to copy
        Returns:
        A copied immutable ServiceCheck instance
      • builder

        public static ImmutableServiceCheck.Builder builder()
        Creates a builder for ImmutableServiceCheck.
         ImmutableServiceCheck.builder()
            .node(com.orbitz.consul.model.health.Node) // required node
            .service(com.orbitz.consul.model.health.Service) // required service
            .addChecks|addAllChecks(com.orbitz.consul.model.health.HealthCheck) // checks elements
            .build();
         
        Returns:
        A new ImmutableServiceCheck builder