adoroszlai opened a new pull request, #9356:
URL: https://github.com/apache/ozone/pull/9356

   ## What changes were proposed in this pull request?
   
   `WithObjectID.Builder` and its subclasses currently provide two similar 
methods for setting `objectID` and `updateID`:
   - `with...ID`: validate input
   - `set...ID`: no validation
   
   This PR moves validation from `with...ID` to `build()` (or rather 
`validate()`, called by `build()`).  That is where other properties (in 
subclasses) are validated, and is common practice for builders.
   
   Benefits:
   
   1. Users of `Builder` do not need to remember to use `with...` for 
validation, thus we can avoid potential bugs.
   2. `getObjectInfo()`, used by validation of `updateID`, did not provide any 
information about the object since builder does not customise `toString()`.  If 
validation fails, the message can now reuse a temporary instance of the value 
object (obtained via `buildMaybeInvalid()`).
   
   Also make `WithParentObjectId` abstract.
   
   https://issues.apache.org/jira/browse/HDDS-13964
   
   ## How was this patch tested?
   
   CI:
   https://github.com/adoroszlai/ozone/actions/runs/19629749773


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to