Skip to content

Instantly share code, notes, and snippets.

@topriddy
Created March 23, 2012 10:05
Show Gist options
  • Save topriddy/2169212 to your computer and use it in GitHub Desktop.
Save topriddy/2169212 to your computer and use it in GitHub Desktop.
A simple Lombok Example, documented here for peace.
package com.topriddy.app;
import lombok.Data;
import lombok.NonNull;
@Data
public class Student {
public enum Sex {MALE, FEMALE};
@NonNull private String matricNumber;
private String lastName;
private String firstName;
private int age;
private Sex sex;
}
package com.topriddy.app;
import com.topriddy.app.Student.Sex;
public class StudentApp {
public static void main(String args[]){
Student student = new Student("CSC/05/64/39");
student.setFirstName("Temitope");
student.setLastName("Faro");
student.setSex(Sex.MALE);
student.setAge(43);
System.out.println("Student: " + student);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment