Class SlackError

java.lang.Object
com.hubspot.slack.client.models.response.SlackError
All Implemented Interfaces:
SlackErrorIF

@Generated(from="SlackErrorIF", generator="Immutables") @ParametersAreNonnullByDefault @Generated("org.immutables.processor.ProxyProcessor") @Immutable public final class SlackError extends Object implements SlackErrorIF
Immutable implementation of SlackErrorIF.

Use the builder to create immutable instances: SlackError.builder(). Use the static factory method to create immutable instances: SlackError.of().

  • Method Details

    • getType

      public SlackErrorType getType()
      Specified by:
      getType in interface SlackErrorIF
      Returns:
      The value of the type attribute
    • getError

      public String getError()
      Specified by:
      getError in interface SlackErrorIF
      Returns:
      The value of the error attribute
    • withType

      public final SlackError withType(SlackErrorType value)
      Copy the current immutable object by setting a value for the type attribute. A value equality check is used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for type
      Returns:
      A modified copy or the this object
    • withError

      public final SlackError withError(String value)
      Copy the current immutable object by setting a value for the error attribute. An equals check used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for error
      Returns:
      A modified copy or the this object
    • equals

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

      public int hashCode()
      Computes a hash code from attributes: type, error.
      Overrides:
      hashCode in class Object
      Returns:
      hashCode value
    • toString

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

      public static SlackError of(String error)
      Construct a new immutable SlackError instance.
      Parameters:
      error - The value for the error attribute
      Returns:
      An immutable SlackError instance
    • copyOf

      public static SlackError copyOf(SlackErrorIF instance)
      Creates an immutable copy of a SlackErrorIF 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 SlackError instance
    • builder

      public static SlackError.Builder builder()
      Creates a builder for SlackError.
       SlackError.builder()
          .setType(com.hubspot.slack.client.models.response.SlackErrorType) // optional type
          .setError(String) // required error
          .build();
       
      Returns:
      A new SlackError builder