6
import java.util.UUID
public class Person implements Serializable {

        private UUID uuid;

        public Person() {
            uuid = UUID.fromString("3856c3da-ea56-4717-9f58-85f6c5f560a5");
        }

        public UUID getUuid() {
            return uuid;
        }
    }
IAdapter
  • 62,595
  • 73
  • 179
  • 242
theJava
  • 14,620
  • 45
  • 131
  • 172

1 Answers1

9

It helps you parse/generate a Universally unique identifier .

ismail
  • 46,010
  • 9
  • 86
  • 95
  • What is the use of it? Why do we use it in our domain model – theJava Dec 31 '10 at 19:08
  • 1
    Its a `unique` number, you can use it to differentiate between users etc. – ismail Dec 31 '10 at 19:09
  • 1
    In the example, all UUIDs are identical. :P – Peter Lawrey Dec 31 '10 at 21:04
  • 1
    @Peter someone should submit it to the TheDailyWTF then :P – ismail Dec 31 '10 at 21:06
  • this example is particularly weird. If this is inside a real application probably is that the class Person shouldn't be used in the system. So by default it points to a non definded person (user nobody or something like that) in the database. Otherwise, I don't find an explanation for this. – Raul Luna Oct 17 '13 at 11:47