Package com.fasterxml.uuid.impl

Examples of com.fasterxml.uuid.impl.TimeBasedGenerator.generate()


      Thread thread = new Thread(new Runnable() {
        @Override
        public void run() {
          for (int j = 0; j < LOOP_COUNT; j++) {

            String id = timeBasedGenerator.generate().toString();
            boolean wasAdded = generatedIds.add(id);
            if (!wasAdded) {
              duplicatedIds.add(id);
            }
          }
View Full Code Here


    private Entry newEntryWithId() throws Exception {
        TimeBasedGenerator uuidGenerator = Generators.timeBasedGenerator(EthernetAddress.fromInterface());
        Entry e = new DefaultEntry();
        e.add(SchemaConstants.OBJECT_CLASS_ATTRIBUTE, uniqueOc);
        e.add(idAttribute, uuidGenerator.generate().toString());
        return e;
    }

}
View Full Code Here

        return LdapUtils.extractAttributeNoEmptyCheck(entry, TimebasedOrderFilter.ID_ATTRIBUTE);
    }

    private static UUID newUUID() {
        TimeBasedGenerator uuidGenerator = Generators.timeBasedGenerator(EthernetAddress.fromInterface());
        return uuidGenerator.generate();
    }

    private static class IdComparator implements Comparator<Entry> {
        @Override
        public int compare(Entry e1, Entry e2) {
View Full Code Here

        long start_time = System.currentTimeMillis();
       
        // now create the array of uuids
        for (int i = 0; i < uuid_array.length; i++)
        {
            uuid_array[i] = uuid_gen.generate();
        }
       
        // now capture the end time
        long end_time = System.currentTimeMillis();
       
View Full Code Here

        // before we generate all the uuids, lets get the start time
        long start_time = System.currentTimeMillis();
       
        // now create the array of uuids
        for (int i = 0; i < uuid_array.length; i++) {
            uuid_array[i] = uuid_gen.generate();
        }
       
        // now capture the end time
        long end_time = System.currentTimeMillis();
       
View Full Code Here

        EthernetAddress eth = EthernetAddress.fromInterface();
        TimeBasedGenerator gen = Generators.timeBasedGenerator(eth, sync);

        int counter = 1;
        while (true) {
            UUID uuid = gen.generate();
      // Default one is for convenient output
            System.out.println("#"+counter+" -> "+uuid);

      /* This allows lexical sorting by uuid... (not very useful,
       * since 'real' UUID ordering is not lexical)
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.