forked from gocodeup/annotations-exercise
-
Notifications
You must be signed in to change notification settings - Fork 23
Expand file tree
/
Copy pathAuthor.java
More file actions
38 lines (32 loc) · 871 Bytes
/
Author.java
File metadata and controls
38 lines (32 loc) · 871 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
/**
* This source file is subject to the license that is bundled with this package in the file LICENSE.
*/
import java.util.ArrayList;
import java.util.List;
@SuppressWarnings("all")
public class Author extends Person {
private List books;
public Author(String firstName, String lastName) {
super(firstName, lastName);
books = new ArrayList();
}
/**
* @deprecated Use publishedBooks instead
*/
@Deprecated
@SuppressWarnings("unchecked")
public List<String> getBooks() {
return books;
}
@SuppressWarnings("unchecked")
public List<String> publishedBooks() {
return books;
}
@SuppressWarnings("unchecked")
public void addBook(String book) {
books.add(book);
}
public String fullName() {
return String.format("%s, %s", lastName, firstName);
}
}