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.

27 lines
593 B

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