本文整理汇总了Java中java.util.UUID.getMostSignificantBits方法的典型用法代码示例。如果您正苦于以下问题:Java UUID.getMostSignificantBits方法的具体用法?Java UUID.getMostSignificantBits怎么用?Java UUID.getMostSignificantBits使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类java.util.UUID
的用法示例。
在下文中一共展示了UUID.getMostSignificantBits方法的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: convert
import java.util.UUID; //导入方法依赖的package包/类
public static byte[] convert(UUID uuid) {
long msb = uuid.getMostSignificantBits();
long lsb = uuid.getLeastSignificantBits();
byte[] buffer = new byte[16];
for (int i = 0; i < 8; i++) {
buffer[i] = (byte) (msb >>> 8 * (7 - i));
}
for (int i = 8; i < 16; i++) {
buffer[i] = (byte) (lsb >>> 8 * (7 - i));
}
return buffer;
}
示例2: VersionedStatsLRURegionEntryHeapUUIDKey
import java.util.UUID; //导入方法依赖的package包/类
public VersionedStatsLRURegionEntryHeapUUIDKey(RegionEntryContext context, UUID key,
Object value) {
super(context, value);
// DO NOT modify this class. It was generated from LeafRegionEntry.cpp
this.keyMostSigBits = key.getMostSignificantBits();
this.keyLeastSigBits = key.getLeastSignificantBits();
}
示例3: NoteNotification
import java.util.UUID; //导入方法依赖的package包/类
public NoteNotification(String parentId, String notificationContent, Long delay) {
this.content = notificationContent;
this.delay = delay;
UUID uuid = UUID.randomUUID();
this.parentId = parentId;
this.id = (int)(uuid.getMostSignificantBits() + uuid.getLeastSignificantBits());
}
示例4: isKeyEqual
import java.util.UUID; //导入方法依赖的package包/类
@Override
public boolean isKeyEqual(Object k) {
if (k instanceof UUID) {
UUID uuid = (UUID) k;
return uuid.getLeastSignificantBits() == this.keyLeastSigBits
&& uuid.getMostSignificantBits() == this.keyMostSigBits;
}
return false;
}
示例5: writeUniqueId
import java.util.UUID; //导入方法依赖的package包/类
public void writeUniqueId(UUID uniqueId) {
long most = uniqueId.getMostSignificantBits();
long least = uniqueId.getLeastSignificantBits();
this.writeLong(most);
this.writeLong(least);
}
示例6: VMStatsDiskLRURegionEntryHeapUUIDKey
import java.util.UUID; //导入方法依赖的package包/类
public VMStatsDiskLRURegionEntryHeapUUIDKey(RegionEntryContext context, UUID key, Object value) {
super(context, (value instanceof RecoveredEntry ? null : value));
// DO NOT modify this class. It was generated from LeafRegionEntry.cpp
initialize(context, value);
this.keyMostSigBits = key.getMostSignificantBits();
this.keyLeastSigBits = key.getLeastSignificantBits();
}
示例7: matchesServiceUuid
import java.util.UUID; //导入方法依赖的package包/类
private boolean matchesServiceUuid(UUID uuid, UUID mask, UUID data) {
if (mask == null) {
return uuid.equals(data);
}
if ((uuid.getLeastSignificantBits() & mask.getLeastSignificantBits()) !=
(data.getLeastSignificantBits() & mask.getLeastSignificantBits())) {
return false;
}
return ((uuid.getMostSignificantBits() & mask.getMostSignificantBits()) ==
(data.getMostSignificantBits() & mask.getMostSignificantBits()));
}
示例8: VMThinRegionEntryOffHeapUUIDKey
import java.util.UUID; //导入方法依赖的package包/类
public VMThinRegionEntryOffHeapUUIDKey(RegionEntryContext context, UUID key,
@Retained Object value) {
super(context, value);
// DO NOT modify this class. It was generated from LeafRegionEntry.cpp
this.keyMostSigBits = key.getMostSignificantBits();
this.keyLeastSigBits = key.getLeastSignificantBits();
}
示例9: VMStatsLRURegionEntryOffHeapUUIDKey
import java.util.UUID; //导入方法依赖的package包/类
public VMStatsLRURegionEntryOffHeapUUIDKey(RegionEntryContext context, UUID key,
@Retained Object value) {
super(context, value);
// DO NOT modify this class. It was generated from LeafRegionEntry.cpp
this.keyMostSigBits = key.getMostSignificantBits();
this.keyLeastSigBits = key.getLeastSignificantBits();
}
示例10: VMStatsDiskRegionEntryOffHeapUUIDKey
import java.util.UUID; //导入方法依赖的package包/类
public VMStatsDiskRegionEntryOffHeapUUIDKey(RegionEntryContext context, UUID key,
@Retained Object value) {
super(context, (value instanceof RecoveredEntry ? null : value));
// DO NOT modify this class. It was generated from LeafRegionEntry.cpp
initialize(context, value);
this.keyMostSigBits = key.getMostSignificantBits();
this.keyLeastSigBits = key.getLeastSignificantBits();
}
示例11: testFormats
import java.util.UUID; //导入方法依赖的package包/类
@Test
public void testFormats() {
UUID uid = UUID.randomUUID();
long hi = uid.getMostSignificantBits();
long lo = uid.getLeastSignificantBits();
String shi = Long.toString(hi, 36);
String slo = Long.toString(lo, 36);
System.out.println(shi);
System.out.println(slo);
System.out.println(shi + slo);
System.out.println(Long.toString(Long.MAX_VALUE, 36));
}
示例12: matchesServiceUuid
import java.util.UUID; //导入方法依赖的package包/类
private static boolean matchesServiceUuid(UUID uuid) {
return SERVICE_UUID_HALF.getMostSignificantBits() == uuid.getMostSignificantBits();
}
示例13: VersionedStatsRegionEntryHeapUUIDKey
import java.util.UUID; //导入方法依赖的package包/类
public VersionedStatsRegionEntryHeapUUIDKey(RegionEntryContext context, UUID key, Object value) {
super(context, value);
// DO NOT modify this class. It was generated from LeafRegionEntry.cpp
this.keyMostSigBits = key.getMostSignificantBits();
this.keyLeastSigBits = key.getLeastSignificantBits();
}