package de.fd.fh.server.user; import dev.morphia.annotations.Embedded; import lombok.*; import org.bson.types.ObjectId; @Getter @Embedded @NoArgsConstructor @AllArgsConstructor(access = AccessLevel.PRIVATE) @EqualsAndHashCode(of = {"identifier"}) public class UserId { private String identifier; public static UserId of(final String identifier) { return new UserId(identifier); } public static UserId random() { return new UserId(new ObjectId().toHexString()); } }