Class ApiResponseDto
java.lang.Object
me.josephsf.jobportaljosephsfeir.dto.ApiResponseDto
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 Summary
ConstructorsConstructorDescriptionApiResponseDto(Boolean success, String message) Constructs a new API response with the specified success status and message. -
Method Summary
Modifier and TypeMethodDescriptionGets the descriptive message about the operation result.Gets the success status of the operation.voidsetMessage(String message) Sets the descriptive message about the operation result.voidsetSuccess(Boolean success) Sets the success status of the operation.
-
Constructor Details
-
ApiResponseDto
Constructs a new API response with the specified success status and message.- Parameters:
success- Boolean indicating if the operation was successfulmessage- Descriptive message providing details about the operation result
-
-
Method Details
-
getSuccess
Gets the success status of the operation.- Returns:
- true if the operation was successful, false otherwise
-
setSuccess
Sets the success status of the operation.- Parameters:
success- true if the operation was successful, false otherwise
-
getMessage
Gets the descriptive message about the operation result.- Returns:
- A string message providing details about the result
-
setMessage
Sets the descriptive message about the operation result.- Parameters:
message- A string message providing details about the result
-