From a29f8c7db790c3d82312f63b750b03bf7d1d5500 Mon Sep 17 00:00:00 2001 From: David Guler Date: Mon, 24 Oct 2022 13:42:31 +0200 Subject: [PATCH] Added IdProvider --- .../java/ch/zhaw/gartenverwaltung/io/IdProvider.java | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 src/main/java/ch/zhaw/gartenverwaltung/io/IdProvider.java diff --git a/src/main/java/ch/zhaw/gartenverwaltung/io/IdProvider.java b/src/main/java/ch/zhaw/gartenverwaltung/io/IdProvider.java new file mode 100644 index 0000000..5842f0d --- /dev/null +++ b/src/main/java/ch/zhaw/gartenverwaltung/io/IdProvider.java @@ -0,0 +1,11 @@ +package ch.zhaw.gartenverwaltung.io; + +public class IdProvider { + private long currentId; + public IdProvider(long initialValue) { + currentId = initialValue; + } + public long incrementAndGet() { + return ++currentId; + } +}