-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
9 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,9 +5,10 @@ | |
import java.util.Calendar; | ||
import java.util.Date; | ||
import java.util.List; | ||
import java.util.UUID; | ||
|
||
/** | ||
* Represents a balldraw, with generation timestamp, Pool size, Draw itself and | ||
* Represents a balldraw, with generation timestamp, UUID, Pool size, Draw itself and | ||
* algorithm used to generate the draw. | ||
* | ||
* @author Nuno Costa ([email protected]) | ||
|
@@ -18,12 +19,14 @@ public class BallDraw { | |
private final Integer pool; | ||
private final List<Integer> draw; | ||
private final DrawAlgorithm algorithm; | ||
private final UUID uid; | ||
|
||
public BallDraw(Integer pool, List<Integer> draw, DrawAlgorithm algorithm) { | ||
this.creationDate = Calendar.getInstance().getTime(); | ||
this.pool = pool; | ||
this.draw = draw; | ||
this.algorithm = algorithm; | ||
uid = UUID.randomUUID(); | ||
} | ||
|
||
public Date getCreationDate() { | ||
|
@@ -50,6 +53,10 @@ public DrawAlgorithm getAlgorithm() { | |
public int getSize() { | ||
return this.draw.size(); | ||
} | ||
|
||
public UUID getUid() { | ||
return this.uid; | ||
} | ||
|
||
@Override | ||
public String toString() { | ||
|
@@ -59,6 +66,7 @@ public String toString() { | |
return "BallDraw [" | ||
+ (creationDate != null ? "creationDate=" + sdf.format(creationDate.getTime()) + ", " | ||
: "") + (pool != null ? "pool=" + pool + ", " : "") | ||
+ (uid != null ? "uid=" + uid.toString() : "") + "]" | ||
+ (draw != null ? "size=" + draw.size() : "") + "]" | ||
+ (draw != null ? "draw=" + draw : "") + "]" | ||
+ (algorithm != null ? "algorithm=" + algorithm : "") + "]"; | ||
|