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.game;
import dev.morphia.annotations.Embedded;
import lombok.*;
import org.bson.types.ObjectId;
@Getter
@Embedded
@NoArgsConstructor
@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());
}
}