question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Clean up lombok annotations in API response models

See original GitHub issue

We can clean up and only annotate our API response models with the following lombok annotations: @EqualsAndHashCode and @ToString

For example:

@EqualsAndHashCode
@ToString
public final class FooResponse {
  @Getter private final String value;
  private final String description;

  public FooResponse(
      @NonNull final String value,
      @Nullable final String description) {
    this.name = checkNotBlank(value);
    this.description = description;
  }

  public Optional<String> getDescription() {
    return Optional.ofNullable(description);
  }
}

NOTE: For a great API response model example, see DatasetResponse

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:8 (8 by maintainers)

github_iconTop GitHub Comments

1reaction
ravikamarajcommented, Aug 5, 2019

@wslulciuc , can you close this issue. thanks.

PS: with recent PR’s, I am following CONTRIBUTING.md to close the issue automatically upon PR approval

0reactions
wslulciuccommented, Aug 5, 2019

Fixed #573

Read more comments on GitHub >

github_iconTop Results From Across the Web

@Cleanup - Project Lombok
You can use @Cleanup to ensure a given resource is automatically cleaned up before the code execution path exits your current scope. You...
Read more >
Introduction to Project Lombok - Baeldung
A comprehensive and very practical introduction to many useful usecases of Project Lombok on standard Java code.
Read more >
How To Use Lombok @Builder And @Data Annotations To ...
Lombok Builder is an annotation that creates complex builder APIs for your class. It can be used on a class, method level, or...
Read more >
Gradle build fails on Lombok annotated classes - Stack Overflow
Thanks Ethan and Roel for your responses. I added more details to show I get compilation errors on getters/setters and log declarations. I...
Read more >
When Should I Use Project Lombok? - Reflectoring
Clean Code. With Lombok, we can replace boiler-plate code with meaningful annotations. They help the developer focus on business logic. Lombok ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found