Upgrade to Pro — share decks privately, control downloads, hide ads and more …

使ってみようLombok

 使ってみようLombok

合同勉強会 in 大都会岡山 -2014 Winter-

Takafumi Yoshida

December 13, 2014
Tweet

More Decks by Takafumi Yoshida

Other Decks in Technology

Transcript

  1. public class Student { private Long id; private String name;

    private String email; public Long getId() { return id; } public void setId(Long id) { this.id = id; } public String getName() { return name; } public void setName(String name) { this.name = name; } public String getEmail() { return email; } public void setEmail(String email) { this.email = email; } }
  2. public class Student { private Long id; private String name;

    private String email; public String toString() { return “Student(id=” + this.id + “, name=” + this.name + “, email=” + this.email; } }
  3. @Getter @Setter public class Student { public Student(String name, String

    email) { if(name == null) { throw new NullPointerException("name"); } this.name = name; this.email = email; } private Long id; private String name; private String email; }
  4. public class Student { public Student(@NonNull String name, String email)

    { this.name = name; this.email = email; } private Long id; private String name; private String email; }
  5. val