Examples of variant()


Examples of java.util.UUID.variant()

      System.out.println( "    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~" );


      UUID uuid = new UUID( strategy.mostSignificantBits, leastSignificantBits );
      System.out.println( "  uuid : " + uuid.toString() );
      System.out.println( "  variant : " + uuid.variant() );
      System.out.println( "  version : " + uuid.version() );
      if ( uuid.variant() != 2 ) {
        throw new RuntimeException( "bad variant" );
      }
      System.out.println( "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~" );
View Full Code Here

Examples of java.util.UUID.variant()

      UUID uuid = new UUID( strategy.mostSignificantBits, leastSignificantBits );
      System.out.println( "  uuid : " + uuid.toString() );
      System.out.println( "  variant : " + uuid.variant() );
      System.out.println( "  version : " + uuid.version() );
      if ( uuid.variant() != 2 ) {
        throw new RuntimeException( "bad variant" );
      }
      System.out.println( "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~" );
    }
  }
View Full Code Here

Examples of java.util.UUID.variant()

      System.out.println( "    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~" );


      UUID uuid = new UUID( strategy.mostSignificantBits, leastSignificantBits );
      System.out.println( "  uuid : " + uuid.toString() );
      System.out.println( "  variant : " + uuid.variant() );
      System.out.println( "  version : " + uuid.version() );
      if ( uuid.variant() != 2 ) {
        throw new RuntimeException( "bad variant" );
      }
      System.out.println( "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~" );
View Full Code Here

Examples of java.util.UUID.variant()

      UUID uuid = new UUID( strategy.mostSignificantBits, leastSignificantBits );
      System.out.println( "  uuid : " + uuid.toString() );
      System.out.println( "  variant : " + uuid.variant() );
      System.out.println( "  version : " + uuid.version() );
      if ( uuid.variant() != 2 ) {
        throw new RuntimeException( "bad variant" );
      }
      System.out.println( "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~" );
    }
  }
View Full Code Here

Examples of java.util.UUID.variant()

      System.out.println( "    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~" );


      UUID uuid = new UUID( strategy.mostSignificantBits, leastSignificantBits );
      System.out.println( "  uuid : " + uuid.toString() );
      System.out.println( "  variant : " + uuid.variant() );
      System.out.println( "  version : " + uuid.version() );
      if ( uuid.variant() != 2 ) {
        throw new RuntimeException( "bad variant" );
      }
      System.out.println( "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~" );
View Full Code Here

Examples of java.util.UUID.variant()

      UUID uuid = new UUID( strategy.mostSignificantBits, leastSignificantBits );
      System.out.println( "  uuid : " + uuid.toString() );
      System.out.println( "  variant : " + uuid.variant() );
      System.out.println( "  version : " + uuid.version() );
      if ( uuid.variant() != 2 ) {
        throw new RuntimeException( "bad variant" );
      }
      System.out.println( "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~" );
    }
  }
View Full Code Here

Examples of java.util.UUID.variant()

  }
 
  private void testRandom(TestHarness harness)
  {
    UUID id = UUID.randomUUID();
    harness.check(id.variant(), 2);
    harness.check(id.version(), 4);
  }

  /**
   * Test variant, version, timestamp, clocksequence, node
View Full Code Here

Examples of java.util.UUID.variant()

    long now = System.currentTimeMillis();
    UUID uuid1 = new UUID(
        strategy.getMostSignificantBits(),
        CustomVersionOneStrategy.generateLeastSignificantBits( now )
    );
    assertEquals( 2, uuid1.variant() );
    assertEquals( 1, uuid1.version() );

    for ( int i = 0; i < 100; i++ ) {
      UUID uuidX = new UUID(
          strategy.getMostSignificantBits(),
View Full Code Here

Examples of java.util.UUID.variant()

    for ( int i = 0; i < 100; i++ ) {
      UUID uuidX = new UUID(
          strategy.getMostSignificantBits(),
          CustomVersionOneStrategy.generateLeastSignificantBits( now )
      );
      assertEquals( 2, uuidX.variant() );
      assertEquals( 1, uuidX.version() );
      assertFalse( uuid1.equals( uuidX ) );
      assertEquals( uuid1.getMostSignificantBits(), uuidX.getMostSignificantBits() );
    }
  }
View Full Code Here

Examples of java.util.UUID.variant()

    UUID uuid = new UUID(
        strategy.getMostSignificantBits(),
        CustomVersionOneStrategy.generateLeastSignificantBits( 0 )
    );
    assertEquals( 2, uuid.variant() );
    assertEquals( 1, uuid.version() );

    uuid = new UUID(
        strategy.getMostSignificantBits(),
        CustomVersionOneStrategy.generateLeastSignificantBits( Long.MAX_VALUE )
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.