2023-02-04 18:49:22 +01:00

35 lines
1.0 KiB
Java

package com.bib.essensbestellungsverwaltung;
import java.util.ArrayList;
import java.util.List;
/**
* one constructor is used to create new parents the other is used to create
* existing parents from database
*
* @author Malte Schulze Hobeling
*/
public class Parent extends User {
List<Child> children;
public Parent(long id, String name, String firstname, String password, String email, Address address,
List<Child> children) {
super(id, name, firstname, password, email, address);
this.children = children;
}
public Parent(String name, String firstname, String password, String email, Address address) {
super(name, firstname, password, email, address);
this.children = new ArrayList<>();
}
public Parent(User user) {
super(user.getId(), user.getName(), user.getFirstname(), user.getPassword(), user.getEmail(), user.getAddress());
this.children = new ArrayList<>();
}
public List<Child> getChildren() {
return children;
}
}