Examples of variant()


Examples of java.util.UUID.variant()

    uuid = new UUID(
        strategy.getMostSignificantBits(),
        CustomVersionOneStrategy.generateLeastSignificantBits( Long.MAX_VALUE )
    );
    assertEquals( 2, uuid.variant() );
    assertEquals( 1, uuid.version() );
  }
}
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()

    public void testU5_1()
    {
        JenaUUID u1 = JenaUUID.generate() ;
        UUID u2 = UUID.fromString(u1.asString()) ;
        assertEquals(u1.getVersion(), u2.version()) ;
        assertEquals(u1.getVariant(), u2.variant()) ;
    }

    public void testU5_2()
    {
        UUID_V1 u1 = factory1.generateV1() ;
View Full Code Here

Examples of java.util.UUID.variant()

        UUID_V1 u1 = factory1.generateV1() ;
        UUID u2 = UUID.fromString(u1.asString()) ;
        assertEquals(u1.getClockSequence(), u2.clockSequence()) ;
        assertEquals(u1.getTimestamp(), u2.timestamp()) ;
        assertEquals(u1.getNode(), u2.node()) ;
        assertEquals(u1.getVariant(), u2.variant()) ;
        assertEquals(u1.getVersion(), u2.version()) ;
        assertEquals(u1.getMostSignificantBits(), u2.getMostSignificantBits()) ;
        assertEquals(u1.getLeastSignificantBits(), u2.getLeastSignificantBits()) ;
    }
View Full Code Here

Examples of java.util.UUID.variant()

    public void testU5_3()
    {
        UUID_V4 u1 = factory4.generateV4() ;
        UUID u2 = UUID.fromString(u1.asString()) ;
        assertEquals(u1.getVariant(), u2.variant()) ;
        assertEquals(u1.getVersion(), u2.version()) ;
        assertEquals(u1.getMostSignificantBits(), u2.getMostSignificantBits()) ;
        assertEquals(u1.getLeastSignificantBits(), u2.getLeastSignificantBits()) ;
    }
View Full Code Here

Examples of java.util.UUID.variant()

    public void testU5_4()
    {
        UUID u1 = UUID.randomUUID() ;
        JenaUUID u2 = JenaUUID.parse(u1.toString()) ;
        assertEquals(u1.version(), u2.getVersion()) ;
        assertEquals(u1.variant(), u2.getVariant()) ;
        assertEquals(u1.getMostSignificantBits(), u2.getMostSignificantBits()) ;
        assertEquals(u1.getLeastSignificantBits(), u2.getLeastSignificantBits()) ;
        assertEquals(u1.toString(), u2.toString()) ;
    }
View Full Code Here

Examples of java.util.UUID.variant()

    {
        JenaUUID u1 = factory1.generate() ;
        UUID u2 = new UUID(u1.getMostSignificantBits(), u1.getLeastSignificantBits()) ;

        assertEquals(u1.getVersion(), u2.version()) ;
        assertEquals(u1.getVariant(), u2.variant()) ;
        assertEquals(u1.getMostSignificantBits(), u2.getMostSignificantBits()) ;
        assertEquals(u1.getLeastSignificantBits(), u2.getLeastSignificantBits()) ;
        assertEquals(u1.toString(), u2.toString()) ;
    }
View Full Code Here

Examples of java.util.UUID.variant()

    {
        JenaUUID u1 = factory4.generate() ;
        UUID u2 = new UUID(u1.getMostSignificantBits(), u1.getLeastSignificantBits()) ;

        assertEquals(u1.getVersion(), u2.version()) ;
        assertEquals(u1.getVariant(), u2.variant()) ;
        assertEquals(u1.getMostSignificantBits(), u2.getMostSignificantBits()) ;
        assertEquals(u1.getLeastSignificantBits(), u2.getLeastSignificantBits()) ;
        assertEquals(u1.toString(), u2.toString()) ;
    }
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
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.