|
|
@ -0,0 +1,27 @@ |
|
|
|
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()); |
|
|
|
} |
|
|
|
} |