You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

25 lines
513 B

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());
}
}