-
Notifications
You must be signed in to change notification settings - Fork 35
implement toString to make Restrictions more readable #962
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weβll occasionally send you account related emails.
Already on GitHub? Sign in to your account
implement toString to make Restrictions more readable #962
Conversation
β¦able Signed-off-by: Nathan Rauh <[email protected]>
Signed-off-by: Nathan Rauh <[email protected]>
| */ | ||
| @Override | ||
| public String toString() { | ||
| StringBuilder s = new StringBuilder(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If possible, avoid variables like s, please, use something like:
textExpression
or any variation like this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I renamed it in the latest commit.
api/src/main/java/jakarta/data/metamodel/restrict/CompositeRestrictionRecord.java
Outdated
Show resolved
Hide resolved
Why not align the (price >= 50 AND price < 100) |
|
Oh, wait, it was already merged? A bit quick, no? I think we should always leave time for reviews/feedback. |
That's a nice improvement, and I like how it is more concise.
I suppose he didn't realize I only created the PR yesterday? I guess we'll use a separate PR for the improvement. |
|
OK, perfect. |
Adds implementation of toString on the built-in Restrictions to display in a concise way that is meaningful.
For example,
name LIKE "Jakarta EE %"Or,
ALL (price GREATER_THAN_EQUAL 50, price LESS_THAN 100)