From 9c87f768ea6fa59f6a2e51a58bdb2b29aa06dd3c Mon Sep 17 00:00:00 2001 From: Kiran Hart Date: Fri, 27 Oct 2023 10:21:40 -0400 Subject: [PATCH] =?UTF-8?q?=F0=9F=86=95=20create=20tracking=20interfaces?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Took 14 seconds --- .../auctionhouse/api/Identifiable.java | 32 +++++++++++++++++ .../tweetzy/auctionhouse/api/Navigable.java | 26 ++++++++++++++ .../tweetzy/auctionhouse/api/Trackable.java | 36 +++++++++++++++++++ 3 files changed, 94 insertions(+) create mode 100644 src/main/java/ca/tweetzy/auctionhouse/api/Identifiable.java create mode 100644 src/main/java/ca/tweetzy/auctionhouse/api/Navigable.java create mode 100644 src/main/java/ca/tweetzy/auctionhouse/api/Trackable.java diff --git a/src/main/java/ca/tweetzy/auctionhouse/api/Identifiable.java b/src/main/java/ca/tweetzy/auctionhouse/api/Identifiable.java new file mode 100644 index 0000000..375fd38 --- /dev/null +++ b/src/main/java/ca/tweetzy/auctionhouse/api/Identifiable.java @@ -0,0 +1,32 @@ +/* + * Auction House + * Copyright 2023 Kiran Hart + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package ca.tweetzy.auctionhouse.api; + +import lombok.NonNull; + +public interface Identifiable { + + /** + * The identifier for the group. + * + * @return The id of the group. + */ + @NonNull + T getId(); +} \ No newline at end of file diff --git a/src/main/java/ca/tweetzy/auctionhouse/api/Navigable.java b/src/main/java/ca/tweetzy/auctionhouse/api/Navigable.java new file mode 100644 index 0000000..e27a1c9 --- /dev/null +++ b/src/main/java/ca/tweetzy/auctionhouse/api/Navigable.java @@ -0,0 +1,26 @@ +/* + * Auction House + * Copyright 2023 Kiran Hart + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package ca.tweetzy.auctionhouse.api; + +public interface Navigable> { + + E next(); + + E previous(); +} \ No newline at end of file diff --git a/src/main/java/ca/tweetzy/auctionhouse/api/Trackable.java b/src/main/java/ca/tweetzy/auctionhouse/api/Trackable.java new file mode 100644 index 0000000..1fe4a56 --- /dev/null +++ b/src/main/java/ca/tweetzy/auctionhouse/api/Trackable.java @@ -0,0 +1,36 @@ +/* + * Auction House + * Copyright 2023 Kiran Hart + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package ca.tweetzy.auctionhouse.api; + +public interface Trackable { + + /** + * Time when the element was created + * + * @return created time + */ + long getTimeCreated(); + + /** + * Time when element was last updated + * + * @return last updated time + */ + long getLastUpdated(); +}