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