Merge branch 'main' of https://github.com/SowinskiBraeden/comp2522
Comments and added some code to the codebase
This commit is contained in:
commit
3730111bab
7 files changed
+29
-29
No files matched your search
@@ -20,10 +20,10 @@ public class Author
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Author constructor
|
* Author constructor
|
||||||
* @param name of the author
|
* @param name Name of the author
|
||||||
* @param dateOfBirth of the author
|
* @param dateOfBirth Date of birth of the author
|
||||||
* @param dateOfDeath of author if they did die (can be null)
|
* @param dateOfDeath Date of death of author if they did die (can be null)
|
||||||
* @param genre that the author writes in
|
* @param genre String representing the genre that the author writes in
|
||||||
*/
|
*/
|
||||||
public Author(
|
public Author(
|
||||||
final Name name,
|
final Name name,
|
||||||
|
|||||||
@@ -16,9 +16,9 @@ public class Autobiography
|
|||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* Autobiography constructor
|
* Autobiography constructor
|
||||||
* @param title of autobiography
|
* @param title String title of autobiography
|
||||||
* @param year published
|
* @param year int year Autobiography was published
|
||||||
* @param author and subject of autobiography
|
* @param author Author and subject of autobiography
|
||||||
*/
|
*/
|
||||||
public Autobiography(
|
public Autobiography(
|
||||||
final String title,
|
final String title,
|
||||||
|
|||||||
@@ -18,10 +18,10 @@ public class Biography
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Biography constructor
|
* Biography constructor
|
||||||
* @param title of Biography
|
* @param title String title of Biography
|
||||||
* @param year published
|
* @param year int Year Biography was published
|
||||||
* @param author of Biography
|
* @param author Author of the Biography
|
||||||
* @param subject that the Biography is about
|
* @param subject Person that the Biography is about
|
||||||
*/
|
*/
|
||||||
public Biography(
|
public Biography(
|
||||||
final String title,
|
final String title,
|
||||||
@@ -38,7 +38,7 @@ public class Biography
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* equals checks if a given object is equal to this object
|
* equals checks if a given object is equal to this object
|
||||||
* @param o the reference object with which to compare.
|
* @param o Object to check if it is equal to this.
|
||||||
* @return if the given object is equal
|
* @return if the given object is equal
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -27,9 +27,9 @@ public class Book
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Book constructor
|
* Book constructor
|
||||||
* @param title of the book
|
* @param title String title of the book
|
||||||
* @param year the book was published
|
* @param year int year the book was published
|
||||||
* @param author of the book
|
* @param author Author of the book
|
||||||
*/
|
*/
|
||||||
public Book(
|
public Book(
|
||||||
final String title,
|
final String title,
|
||||||
@@ -83,7 +83,7 @@ public class Book
|
|||||||
/**
|
/**
|
||||||
* compareTo another book, books are equal if they are written in the same
|
* compareTo another book, books are equal if they are written in the same
|
||||||
* year
|
* year
|
||||||
* @param other book to compare to
|
* @param other Book to compare to
|
||||||
* @return if the given book is older, newer or same age as this book
|
* @return if the given book is older, newer or same age as this book
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -20,8 +20,8 @@ public class Name
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Name constructor
|
* Name constructor
|
||||||
* @param first name to save
|
* @param first name of the person
|
||||||
* @param last name to save
|
* @param last name of the person
|
||||||
*/
|
*/
|
||||||
public Name(final String first, final String last)
|
public Name(final String first, final String last)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -24,9 +24,9 @@ public class Person
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Person construct
|
* Person construct
|
||||||
* @param dateOfBirth of person, cannot be null
|
* @param dateOfBirth Date of birth of person, cannot be null
|
||||||
* @param dateOfDeath of person, can be null
|
* @param dateOfDeath Date of death of person, can be null
|
||||||
* @param name of person
|
* @param name name of the person
|
||||||
*/
|
*/
|
||||||
public Person(
|
public Person(
|
||||||
final Date dateOfBirth,
|
final Date dateOfBirth,
|
||||||
@@ -94,7 +94,7 @@ public class Person
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* compareTo another person based on date of birth
|
* compareTo another person based on date of birth
|
||||||
* @param other person to compare
|
* @param other Person to compare to
|
||||||
* @return if a person is older, younger or same age
|
* @return if a person is older, younger or same age
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
@@ -104,7 +104,7 @@ public class Person
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* equals checks if another given object is equal to this object
|
* equals checks if another given object is equal to this object
|
||||||
* @param o the reference object with which to compare.
|
* @param o Object to check if equal to this
|
||||||
* @return if given object are equals
|
* @return if given object are equals
|
||||||
*/
|
*/
|
||||||
public boolean equals(final Object o) {
|
public boolean equals(final Object o) {
|
||||||
|
|||||||
@@ -16,8 +16,8 @@ public final class Validator
|
|||||||
/**
|
/**
|
||||||
* validateString ensures a string is not empty, blank,
|
* validateString ensures a string is not empty, blank,
|
||||||
* null or greater than maxLength
|
* null or greater than maxLength
|
||||||
* @param string to validate
|
* @param string String to validate
|
||||||
* @param maxLength that string can be
|
* @param maxLength int max length that string can be
|
||||||
*/
|
*/
|
||||||
public static void validateString(final String string, final int maxLength) {
|
public static void validateString(final String string, final int maxLength) {
|
||||||
if (string == null || string.isEmpty()) {
|
if (string == null || string.isEmpty()) {
|
||||||
@@ -31,7 +31,7 @@ public final class Validator
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* validateObject ensures a given object is not null
|
* validateObject ensures a given object is not null
|
||||||
* @param object to ensure is not null
|
* @param object Object to ensure is not null
|
||||||
* @param objectName variable name of object for log
|
* @param objectName variable name of object for log
|
||||||
*/
|
*/
|
||||||
public static void validateObject(
|
public static void validateObject(
|
||||||
@@ -46,9 +46,9 @@ public final class Validator
|
|||||||
/**
|
/**
|
||||||
* validateInteger ensures a given number is within
|
* validateInteger ensures a given number is within
|
||||||
* the correct provided range
|
* the correct provided range
|
||||||
* @param number to validate
|
* @param number int to validate
|
||||||
* @param min of range inclusive
|
* @param min minimum int of range inclusive
|
||||||
* @param max of range inclusive
|
* @param max maximum int of range inclusive
|
||||||
*/
|
*/
|
||||||
public static void validateInteger(
|
public static void validateInteger(
|
||||||
final int number,
|
final int number,
|
||||||
|
|||||||
Reference in new issue
Block a user