@@ -1208,78 +1208,66 @@ public static UUID getShortSuffixComb() {
1208
1208
// Lazy holders
1209
1209
// ***************************************
1210
1210
1211
- private static final Proxy UUID1 = new Proxy (Suppliers .UUID1 );
1212
- private static final Proxy UUID1_MAC = new Proxy (Suppliers .UUID1_MAC );
1213
- private static final Proxy UUID1_HASH = new Proxy (Suppliers .UUID1_HASH );
1214
- private static final Proxy UUID1_RANDOM = new Proxy (Suppliers .UUID1_RANDOM );
1215
- private static final Proxy UUID2 = new Proxy (Suppliers .UUID2 );
1216
- private static final Proxy UUID2_MAC = new Proxy (Suppliers .UUID2_MAC );
1217
- private static final Proxy UUID2_HASH = new Proxy (Suppliers .UUID2_HASH );
1218
- private static final Proxy UUID2_RANDOM = new Proxy (Suppliers .UUID2_RANDOM );
1219
- private static final Proxy UUID3 = new Proxy (Suppliers .UUID3 );
1220
- private static final Proxy UUID4 = new Proxy (Suppliers .UUID4 );
1221
- private static final Proxy UUID4_FAST = new Proxy (Suppliers .UUID4_FAST );
1222
- private static final Proxy UUID5 = new Proxy (Suppliers .UUID5 );
1223
- private static final Proxy UUID6 = new Proxy (Suppliers .UUID6 );
1224
- private static final Proxy UUID6_MAC = new Proxy (Suppliers .UUID6_MAC );
1225
- private static final Proxy UUID6_HASH = new Proxy (Suppliers .UUID6_HASH );
1226
- private static final Proxy UUID6_RANDOM = new Proxy (Suppliers .UUID6_RANDOM );
1227
- private static final Proxy UUID7 = new Proxy (Suppliers .UUID7 );
1228
- private static final Proxy UUID7_FAST = new Proxy (Suppliers .UUID7_FAST );
1229
- private static final Proxy UUID7_PLUS_1 = new Proxy (Suppliers .UUID7_PLUS_1 );
1230
- private static final Proxy UUID7_PLUS_N = new Proxy (Suppliers .UUID7_PLUS_N );
1231
- private static final Proxy COMB_PREFIX = new Proxy (Suppliers .COMB_PREFIX );
1232
- private static final Proxy COMB_SUFFIX = new Proxy (Suppliers .COMB_SUFFIX );
1233
- private static final Proxy COMB_SHORT_PREFIX = new Proxy (Suppliers .COMB_SHORT_PREFIX );
1234
- private static final Proxy COMB_SHORT_SUFFIX = new Proxy (Suppliers .COMB_SHORT_SUFFIX );
1235
-
1236
- private static enum Suppliers {
1237
-
1238
- UUID1 (TimeBasedFactory ::new ), //
1239
- UUID1_MAC (() -> TimeBasedFactory .builder ().withMacNodeId ().build ()), //
1240
- UUID1_HASH (() -> TimeBasedFactory .builder ().withHashNodeId ().build ()), //
1241
- UUID1_RANDOM (() -> TimeBasedFactory .builder ().withRandomNodeId ().build ()), //
1242
- UUID2 (DceSecurityFactory ::new ), //
1243
- UUID2_MAC (() -> DceSecurityFactory .builder ().withMacNodeId ().build ()), //
1244
- UUID2_HASH (() -> DceSecurityFactory .builder ().withHashNodeId ().build ()), //
1245
- UUID2_RANDOM (() -> DceSecurityFactory .builder ().withRandomNodeId ().build ()), //
1246
- UUID3 (NameBasedMd5Factory ::new ), //
1247
- UUID4 (RandomBasedFactory ::new ), //
1248
- UUID4_FAST (() -> RandomBasedFactory .builder ().withFastRandom ().build ()), //
1249
- UUID5 (NameBasedSha1Factory ::new ), //
1250
- UUID6 (TimeOrderedFactory ::new ), //
1251
- UUID6_MAC (() -> TimeOrderedFactory .builder ().withMacNodeId ().build ()), //
1252
- UUID6_HASH (() -> TimeOrderedFactory .builder ().withHashNodeId ().build ()), //
1253
- UUID6_RANDOM (() -> TimeOrderedFactory .builder ().withRandomNodeId ().build ()), //
1254
- UUID7 (TimeOrderedEpochFactory ::new ), //
1255
- UUID7_FAST (() -> TimeOrderedEpochFactory .builder ().withFastRandom ().build ()), //
1256
- UUID7_PLUS_1 (() -> TimeOrderedEpochFactory .builder ().withIncrementPlus1 ().build ()), //
1257
- UUID7_PLUS_N (() -> TimeOrderedEpochFactory .builder ().withIncrementPlusN ().build ()), //
1258
- COMB_PREFIX (PrefixCombFactory ::new ), //
1259
- COMB_SUFFIX (SuffixCombFactory ::new ), //
1260
- COMB_SHORT_PREFIX (ShortPrefixCombFactory ::new ), //
1261
- COMB_SHORT_SUFFIX (ShortSuffixCombFactory ::new ), //
1262
- ;
1263
-
1264
- private final Supplier <UuidFactory > supplier ;
1265
-
1266
- Suppliers (Supplier <UuidFactory > supplier ) {
1267
- this .supplier = supplier ;
1268
- }
1269
-
1270
- public Supplier <UuidFactory > getValue () {
1271
- return this .supplier ;
1272
- }
1273
- }
1211
+ private static final Proxy UUID1 = new Proxy (Proxy .UUID1 );
1212
+ private static final Proxy UUID1_MAC = new Proxy (Proxy .UUID1_MAC );
1213
+ private static final Proxy UUID1_HASH = new Proxy (Proxy .UUID1_HASH );
1214
+ private static final Proxy UUID1_RANDOM = new Proxy (Proxy .UUID1_RANDOM );
1215
+ private static final Proxy UUID2 = new Proxy (Proxy .UUID2 );
1216
+ private static final Proxy UUID2_MAC = new Proxy (Proxy .UUID2_MAC );
1217
+ private static final Proxy UUID2_HASH = new Proxy (Proxy .UUID2_HASH );
1218
+ private static final Proxy UUID2_RANDOM = new Proxy (Proxy .UUID2_RANDOM );
1219
+ private static final Proxy UUID3 = new Proxy (Proxy .UUID3 );
1220
+ private static final Proxy UUID4 = new Proxy (Proxy .UUID4 );
1221
+ private static final Proxy UUID4_FAST = new Proxy (Proxy .UUID4_FAST );
1222
+ private static final Proxy UUID5 = new Proxy (Proxy .UUID5 );
1223
+ private static final Proxy UUID6 = new Proxy (Proxy .UUID6 );
1224
+ private static final Proxy UUID6_MAC = new Proxy (Proxy .UUID6_MAC );
1225
+ private static final Proxy UUID6_HASH = new Proxy (Proxy .UUID6_HASH );
1226
+ private static final Proxy UUID6_RANDOM = new Proxy (Proxy .UUID6_RANDOM );
1227
+ private static final Proxy UUID7 = new Proxy (Proxy .UUID7 );
1228
+ private static final Proxy UUID7_FAST = new Proxy (Proxy .UUID7_FAST );
1229
+ private static final Proxy UUID7_PLUS_1 = new Proxy (Proxy .UUID7_PLUS_1 );
1230
+ private static final Proxy UUID7_PLUS_N = new Proxy (Proxy .UUID7_PLUS_N );
1231
+ private static final Proxy COMB_PREFIX = new Proxy (Proxy .COMB_PREFIX );
1232
+ private static final Proxy COMB_SUFFIX = new Proxy (Proxy .COMB_SUFFIX );
1233
+ private static final Proxy COMB_SHORT_PREFIX = new Proxy (Proxy .COMB_SHORT_PREFIX );
1234
+ private static final Proxy COMB_SHORT_SUFFIX = new Proxy (Proxy .COMB_SHORT_SUFFIX );
1274
1235
1275
1236
private static class Proxy extends UuidFactory {
1276
1237
1277
1238
private UuidFactory factory = null ;
1278
1239
private Supplier <UuidFactory > supplier ;
1279
1240
private static final ReentrantLock lock = new ReentrantLock ();
1280
1241
1281
- public Proxy (Suppliers supplier ) {
1282
- this .supplier = (Supplier <UuidFactory >) supplier .getValue ();
1242
+ // @formatter:off
1243
+ static final Supplier <UuidFactory > UUID1 = TimeBasedFactory ::new ;
1244
+ static final Supplier <UuidFactory > UUID1_MAC = () -> TimeBasedFactory .builder ().withMacNodeId ().build ();
1245
+ static final Supplier <UuidFactory > UUID1_HASH = () -> TimeBasedFactory .builder ().withHashNodeId ().build ();
1246
+ static final Supplier <UuidFactory > UUID1_RANDOM = () -> TimeBasedFactory .builder ().withRandomNodeId ().build ();
1247
+ static final Supplier <UuidFactory > UUID2 = DceSecurityFactory ::new ;
1248
+ static final Supplier <UuidFactory > UUID2_MAC = () -> DceSecurityFactory .builder ().withMacNodeId ().build ();
1249
+ static final Supplier <UuidFactory > UUID2_HASH = () -> DceSecurityFactory .builder ().withHashNodeId ().build ();
1250
+ static final Supplier <UuidFactory > UUID2_RANDOM = () -> DceSecurityFactory .builder ().withRandomNodeId ().build ();
1251
+ static final Supplier <UuidFactory > UUID3 = NameBasedMd5Factory ::new ;
1252
+ static final Supplier <UuidFactory > UUID4 = RandomBasedFactory ::new ;
1253
+ static final Supplier <UuidFactory > UUID4_FAST = () -> RandomBasedFactory .builder ().withFastRandom ().build ();
1254
+ static final Supplier <UuidFactory > UUID5 = NameBasedSha1Factory ::new ;
1255
+ static final Supplier <UuidFactory > UUID6 = TimeOrderedFactory ::new ;
1256
+ static final Supplier <UuidFactory > UUID6_MAC = () -> TimeOrderedFactory .builder ().withMacNodeId ().build ();
1257
+ static final Supplier <UuidFactory > UUID6_HASH = () -> TimeOrderedFactory .builder ().withHashNodeId ().build ();
1258
+ static final Supplier <UuidFactory > UUID6_RANDOM = () -> TimeOrderedFactory .builder ().withRandomNodeId ().build ();
1259
+ static final Supplier <UuidFactory > UUID7 = TimeOrderedEpochFactory ::new ;
1260
+ static final Supplier <UuidFactory > UUID7_FAST = () -> TimeOrderedEpochFactory .builder ().withFastRandom ().build ();
1261
+ static final Supplier <UuidFactory > UUID7_PLUS_1 = () -> TimeOrderedEpochFactory .builder ().withIncrementPlus1 ().build ();
1262
+ static final Supplier <UuidFactory > UUID7_PLUS_N = () -> TimeOrderedEpochFactory .builder ().withIncrementPlusN ().build ();
1263
+ static final Supplier <UuidFactory > COMB_PREFIX = PrefixCombFactory ::new ;
1264
+ static final Supplier <UuidFactory > COMB_SUFFIX = SuffixCombFactory ::new ;
1265
+ static final Supplier <UuidFactory > COMB_SHORT_PREFIX = ShortPrefixCombFactory ::new ;
1266
+ static final Supplier <UuidFactory > COMB_SHORT_SUFFIX = ShortSuffixCombFactory ::new ;
1267
+ // @formatter:on
1268
+
1269
+ public Proxy (Supplier <UuidFactory > supplier ) {
1270
+ this .supplier = supplier ;
1283
1271
}
1284
1272
1285
1273
private UuidFactory get () {
0 commit comments