public UUID asUuid ( final UuidRepresentation uuidRepresentation ) { Assertions . notNull ( "uuidRepresentation" , uuidRepresentation ) ; final byte uuidType = uuidRepresentation == UuidRepresentation . STANDARD ? BsonBinarySubType . UUID_STANDARD . getValue ( ) : BsonBinarySubType . UUID_LEGACY . getValue ( ) ; if ( type != uuidType ) { throw new BsonInvalidOperationException ( "uuidRepresentation does not match current uuidRepresentation." ) ; } return UuidHelper . decodeBinaryToUuid ( data . clone ( ) , type , uuidRepresentation ) ; }
Returns the binary as a UUID .