Вопрос

I am porting some C# code to the Android platform. The code makes heavy use of nullable GUIDs. I understand they don't exist in Java, so what would be the best way to implement this feature? I am thinking of just using an "empty" GUID (00000000-0000-0000-0000-000000000000) to represent a null value.

Это было полезно?

Решение

java.util.UUID is a class in Java, which means a reference to this type can have the value null. The C# type that can't be represented in Java is a non-nullable UUID.

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top