I want my coworkers to not ignore result of method, f.e. in builder, when You do not build object. I have fluent api that will log message. If someone will not used final method to log, the log message will be gone. How I can Warn, or compile error when such case occurs. F.e.: Success case- message will be logged in log file/console:
logbuilder.text("").level("").log();
Failure case- message will NOT be logged in log file/console:
logbuilder.text("").level("");
I would like compiler to fail in such case. Please help. Thanks.