Advertisement
libdo

Untitled

Sep 20th, 2017
159
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. public class ImmutableObject {
  2.  
  3. private final String string;
  4. private final Date date;
  5.  
  6. public ImmutableObject(String string, Date date) {
  7. this.string = string;
  8. this.date = date;
  9. }
  10.  
  11. public Date getDate() {
  12. return new Date(date.getTime());
  13. }
  14.  
  15. public String getString() {
  16. return string;
  17. }
  18.  
  19. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement