Class ApiResponseDto

java.lang.Object
me.josephsf.jobportaljosephsfeir.dto.ApiResponseDto

public class ApiResponseDto extends Object
Data Transfer Object (DTO) for API response messages in the Job Portal application.

This class provides a standardized structure for API responses, particularly for operations that don't return entity data but need to communicate success status and descriptive messages to the client. It is commonly used for operations like user registration, profile deletion, and other actions where the primary response is a success/failure indication with an explanatory message.

The class contains two main fields:

  • success - A boolean indicating whether the operation succeeded (true) or failed (false)
  • message - A string providing details about the result of the operation
Since:
2025-05-14
  • Constructor Details

    • ApiResponseDto

      public ApiResponseDto(Boolean success, String message)
      Constructs a new API response with the specified success status and message.
      Parameters:
      success - Boolean indicating if the operation was successful
      message - Descriptive message providing details about the operation result
  • Method Details

    • getSuccess

      public Boolean getSuccess()
      Gets the success status of the operation.
      Returns:
      true if the operation was successful, false otherwise
    • setSuccess

      public void setSuccess(Boolean success)
      Sets the success status of the operation.
      Parameters:
      success - true if the operation was successful, false otherwise
    • getMessage

      public String getMessage()
      Gets the descriptive message about the operation result.
      Returns:
      A string message providing details about the result
    • setMessage

      public void setMessage(String message)
      Sets the descriptive message about the operation result.
      Parameters:
      message - A string message providing details about the result