Class ImmutableUserCreationResponse

java.lang.Object
com.iland.core.web.rest.response.user.ImmutableUserCreationResponse
All Implemented Interfaces:
UserCreationResponse

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

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

  • Method Details

    • username

      public String username()
      The username of the user that was requested to create.
      Specified by:
      username in interface UserCreationResponse
      Returns:
      String username
    • created

      public boolean created()
      Whether or not the username was created.
      Specified by:
      created in interface UserCreationResponse
      Returns:
      whether username was created
    • error

      public Optional<String> error()
      Error returned when creating user, if any.
      Specified by:
      error in interface UserCreationResponse
      Returns:
      Optional of String error
    • withUsername

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

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

      public final ImmutableUserCreationResponse withError(String value)
      Copy the current immutable object by setting a present value for the optional error attribute.
      Parameters:
      value - The value for error
      Returns:
      A modified copy of this object
    • withError

      public final ImmutableUserCreationResponse withError(Optional<String> optional)
      Copy the current immutable object by setting an optional value for the error attribute. An equality check is used on inner nullable value to prevent copying of the same value by returning this.
      Parameters:
      optional - A value for error
      Returns:
      A modified copy of this object
    • equals

      public boolean equals(@Nullable Object another)
      This instance is equal to all instances of ImmutableUserCreationResponse 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: username, created, error.
      Overrides:
      hashCode in class Object
      Returns:
      hashCode value
    • toString

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

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

      public static ImmutableUserCreationResponse.Builder builder()
      Creates a builder for ImmutableUserCreationResponse.
       ImmutableUserCreationResponse.builder()
          .username(String) // required username
          .created(boolean) // required created
          .error(String) // optional error
          .build();
       
      Returns:
      A new ImmutableUserCreationResponse builder