-
Notifications
You must be signed in to change notification settings - Fork 8
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
refactor: add name to view for the get views endpoint #256
Conversation
public String toString() { | ||
return getName(); | ||
} | ||
protected String name; |
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.
Can you keep whitespaces on tabs?
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.
This is the default java formatting in IntelliJ
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.
Please keep the formatting as is (like all other files in the project) to keep the project consistent and make reviewing easier
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 would like to, however there's no way to enforce this or tell my IDE to use a specific format, as there is none defined.
The only way to do this that I see is to ask ChatGPT to fix my indentation by supplying the new file and the old file with the indentation. I don't think that's supposed to be the way as it makes contributing to this project very cumbersome. Can you tell me how I can do this more efficiently?
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 tried to ask ChatGPT and it couldn't even do it.
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 fixed it as much as possible
} | ||
|
||
public Map<String, Object> toHashMap(boolean isDefaultView) { | ||
Map<String, String> metadataTypes = new HashMap<>(); |
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.
Why call it toHashMap instead of toMap?
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.
Because Map is the interface type and HashMap the implemented returned type, I think it makes sense to return the actual type instead of its supertype.
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 would say use interface types for your "API" / what you expose to the outside world and use a specific type internally which you can change when needed without breaking the contract of your method (as far as I know this is common practice)
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.
Fixed this
return Response.status(Response.Status.BAD_REQUEST).entity("No settings have been provided - detailed error message - The settings that have been provided are " + map).build(); | ||
} | ||
private @Setter | ||
@Inject |
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.
What happened on this line (newlines added)?
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.
It's the default java formatting again
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.
Again, please change :)
In order to make sure that the view models have all the data needed in the frontend, I've added their name to the map that is returned in the endpoint, so the name is not just the key in the map.