SHARE
TWEET

Untitled

a guest Aug 24th, 2019 67 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. package com.cristian;
  2.  
  3. import java.util.Optional;
  4.  
  5. public class Person {
  6.  
  7.     private int id;
  8.     private String name;
  9.     private Car car;
  10.  
  11.     public Person(int id, String name) {
  12.         this.id = id;
  13.         this.name = name;
  14.     }
  15.  
  16.     public Person(int id, String name, Car car) {
  17.         this.id = id;
  18.         this.name = name;
  19.         this.car = car;
  20.     }
  21.  
  22.     public int getId() {
  23.         return id;
  24.     }
  25.  
  26.     public void setId(int id) {
  27.         this.id = id;
  28.     }
  29.  
  30.     public String getName() {
  31.         return name;
  32.     }
  33.  
  34.     public void setName(String name) {
  35.         this.name = name;
  36.     }
  37.  
  38.     public Optional<Car> getCar() {
  39.         return Optional.ofNullable(car);
  40.     }
  41.  
  42.     public void setCar(Car car) {
  43.         this.car = car;
  44.     }
  45.  
  46. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top