Skip to content

Instantly share code, notes, and snippets.

@deximat
Created August 19, 2014 19:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save deximat/0b3638a6320bbb5bb178 to your computer and use it in GitHub Desktop.
Save deximat/0b3638a6320bbb5bb178 to your computer and use it in GitHub Desktop.
Enum as immutable java objects.
package com.codlex.deximat.raf.third_year.web_programming.exam.project.part2.messages;
public enum CancelReservationResponse {
PASSENGER_DOESNT_EXIST("Reservation cancellation unssuccesful selected passinger doesn't exist."),
FLIGHT_DOESNT_EXIST("Reservation cancellation unssuccesful selected flight doesn't exist."),
RESERVATION_NOT_POSSIBLE_TOO_LATE("Reservations can't be canceled if flight is within next 24 hours."),
SUCCESS(null),
WRONG_FLIGHT("Reservation cancellation unssuccesful selected passinger isn't on flight.");
private String description;
private CancelReservationResponse(String description) {
this.description = description;
}
public String getDescription() {
return this.description;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment