Commit 5e156efb authored by Oskars's avatar Oskars
Browse files

Update: updated BusinessUser class, added few methods

parent 1f9f0a12
......@@ -16,26 +16,32 @@ public class BusinessUser extends User{
public BusinessUser (String nameAndSurname, String username, String password, ArrayList<Page> listOfPages) {
super(nameAndSurname, username, password);
this.listOfPages = (listOfPages != null)? listOfPages : new ArrayList<Page>();
setListOfPages(listOfPages);
}
//SETTERS
public ArrayList<Page> getListOfPages() {
return listOfPages;
}
//GETTERS
public void setListOfPages(ArrayList<Page> listOfPages) {
this.listOfPages = (listOfPages != null)? listOfPages : new ArrayList<Page>();
}
//GETTERS
public ArrayList<Page> getListOfPages() {
return listOfPages;
}
//OTHER METHODS
public String toString() {
return super.toString() + ", Pages: " + listOfPages.size();
}
public void createPage() {
Page page = new Page();
listOfPages.add(page);
}
public void createPage(String title, String description, ArrayList<User> followers, ArrayList<Post> postsInPage) {
Page page = new Page(title,description, followers, postsInPage);
listOfPages.add(page);
}
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment