Created
March 23, 2012 10:05
-
-
Save topriddy/2169212 to your computer and use it in GitHub Desktop.
A simple Lombok Example, documented here for peace.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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