Skip to content

Instantly share code, notes, and snippets.

@alainlompo
Created March 9, 2017 17:52
Show Gist options
  • Save alainlompo/004165e7a8373f32b2236422c0ce093b to your computer and use it in GitHub Desktop.
Save alainlompo/004165e7a8373f32b2236422c0ce093b to your computer and use it in GitHub Desktop.
Lombok annotations samples: @DaTa generates getters and setters. @EqualsAndHashCode generates equals and hashCode methods without calling super. AccessLevel allows a finer specification of visibility
import java.math.BigDecimal;
import lombok.AccessLevel;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.Getter;
import lombok.Setter;
@Data
@EqualsAndHashCode(callSuper=false)
public class Asset extends Resource{
@Getter(AccessLevel.PROTECTED)
@Setter(AccessLevel.PROTECTED)
private BigDecimal monetaryValueInReportingCurrency;
public Asset(String name, String description) {
super(name, description);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment