No-operation UUID factory, providing only default Java random UUIDs.
[lgpl/argeo-commons.git] / org.argeo.api.uuid / src / org / argeo / api / uuid / ConcurrentUuidFactory.java
index 4ad2290b9c52d1ee9cb80efd240920747d7d8fa0..14f6d54adb0d25467ad58c732fdc4654704a367c 100644 (file)
@@ -17,6 +17,7 @@ import java.security.SecureRandom;
 import java.util.BitSet;
 import java.util.Enumeration;
 import java.util.Objects;
+import java.util.UUID;
 
 /**
  * A configurable implementation of an {@link AsyncUuidFactory}, which can be
@@ -46,6 +47,18 @@ public class ConcurrentUuidFactory extends AbstractAsyncUuidFactory {
                assert newTimeUUID().node() == BitSet.valueOf(defaultNodeId).toLongArray()[0];
        }
 
+       /*
+        * DEFAULT
+        */
+       /**
+        * The default {@link UUID} to provide. This implementations returns
+        * {@link #timeUUID()} because it is fast and uses few resources.
+        */
+       @Override
+       public UUID get() {
+               return timeUUID();
+       }
+
        @Override
        protected SecureRandom newSecureRandom() {
                SecureRandom secureRandom;