Commits

Roy Curtis authored and md_5 committed eb9f4ee387c
Improvements to BookMeta API

* Added hasGeneration() * Corrected javadoc of methods for consistency and accuracy according to CraftBukkit behavior
No tags

src/main/java/org/bukkit/inventory/meta/BookMeta.java

Modified
55 55 * Limited to 16 characters. Removes title when given null.
56 56 *
57 57 * @param title the title to set
58 58 * @return true if the title was successfully set
59 59 */
60 60 boolean setTitle(String title);
61 61
62 62 /**
63 63 * Checks for the existence of an author in the book.
64 64 *
65 - * @return the author of the book
65 + * @return true if the book has an author
66 66 */
67 67 boolean hasAuthor();
68 68
69 69 /**
70 70 * Gets the author of the book.
71 71 * <p>
72 72 * Plugins should check that hasAuthor() returns true before calling this
73 73 * method.
74 74 *
75 75 * @return the author of the book
76 76 */
77 77 String getAuthor();
78 78
79 79 /**
80 80 * Sets the author of the book. Removes author when given null.
81 81 *
82 - * @param author the author of the book
82 + * @param author the author to set
83 83 */
84 84 void setAuthor(String author);
85 85
86 86 /**
87 - * Gets the generation of the book, or null if it's out of bounds.
87 + * Checks for the existence of generation level in the book.
88 88 *
89 - * @return the generation of the book or null
89 + * @return true if the book has a generation level
90 90 */
91 - Generation getGeneration();
91 + boolean hasGeneration();
92 92
93 93 /**
94 - * Sets the generation of the book.
94 + * Gets the generation of the book.
95 95 * <p>
96 - * Assumes Generation.ORIGINAL if given null.
96 + * Plugins should check that hasGeneration() returns true before calling
97 + * this method.
98 + *
99 + * @return the generation of the book
100 + */
101 + Generation getGeneration();
102 +
103 + /**
104 + * Sets the generation of the book. Removes generation when given null.
97 105 *
98 - * @param generation the generation of the book
106 + * @param generation the generation to set
99 107 */
100 108 void setGeneration(Generation generation);
101 109
102 110 /**
103 111 * Checks for the existence of pages in the book.
104 112 *
105 113 * @return true if the book has pages
106 114 */
107 115 boolean hasPages();
108 116

Everything looks good. We'll let you know here if there's anything you should know about.

Add shortcut