-
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
1 parent
ef5e165
commit 1cb1aa6
Showing
5 changed files
with
113 additions
and
0 deletions.
There are no files selected for viewing
21 changes: 21 additions & 0 deletions
21
src/main/java/onlydust/com/marketplace/kernel/model/ProgramId.java
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 |
---|---|---|
@@ -0,0 +1,21 @@ | ||
package onlydust.com.marketplace.kernel.model; | ||
|
||
import lombok.EqualsAndHashCode; | ||
import lombok.NoArgsConstructor; | ||
import lombok.NonNull; | ||
import lombok.experimental.SuperBuilder; | ||
|
||
import java.util.UUID; | ||
|
||
@NoArgsConstructor(staticName = "random") | ||
@EqualsAndHashCode(callSuper = true) | ||
@SuperBuilder | ||
public class ProgramId extends UuidWrapper { | ||
public static ProgramId of(@NonNull final UUID uuid) { | ||
return ProgramId.builder().uuid(uuid).build(); | ||
} | ||
|
||
public static ProgramId of(@NonNull final String uuid) { | ||
return ProgramId.of(UUID.fromString(uuid)); | ||
} | ||
} |
21 changes: 21 additions & 0 deletions
21
src/main/java/onlydust/com/marketplace/kernel/model/ProjectId.java
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 |
---|---|---|
@@ -0,0 +1,21 @@ | ||
package onlydust.com.marketplace.kernel.model; | ||
|
||
import lombok.EqualsAndHashCode; | ||
import lombok.NoArgsConstructor; | ||
import lombok.NonNull; | ||
import lombok.experimental.SuperBuilder; | ||
|
||
import java.util.UUID; | ||
|
||
@NoArgsConstructor(staticName = "random") | ||
@EqualsAndHashCode(callSuper = true) | ||
@SuperBuilder | ||
public class ProjectId extends UuidWrapper { | ||
public static ProjectId of(@NonNull final UUID uuid) { | ||
return ProjectId.builder().uuid(uuid).build(); | ||
} | ||
|
||
public static ProjectId of(@NonNull final String uuid) { | ||
return ProjectId.of(UUID.fromString(uuid)); | ||
} | ||
} |
25 changes: 25 additions & 0 deletions
25
src/main/java/onlydust/com/marketplace/kernel/model/RewardId.java
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 |
---|---|---|
@@ -0,0 +1,25 @@ | ||
package onlydust.com.marketplace.kernel.model; | ||
|
||
import lombok.EqualsAndHashCode; | ||
import lombok.NoArgsConstructor; | ||
import lombok.NonNull; | ||
import lombok.experimental.SuperBuilder; | ||
|
||
import java.util.UUID; | ||
|
||
@NoArgsConstructor(staticName = "random") | ||
@EqualsAndHashCode(callSuper = true) | ||
@SuperBuilder | ||
public class RewardId extends UuidWrapper { | ||
public static RewardId of(@NonNull final UUID uuid) { | ||
return RewardId.builder().uuid(uuid).build(); | ||
} | ||
|
||
public static RewardId of(@NonNull final String uuid) { | ||
return RewardId.of(UUID.fromString(uuid)); | ||
} | ||
|
||
public String pretty() { | ||
return "#" + this.value().toString().substring(0, 5).toUpperCase(); | ||
} | ||
} |
25 changes: 25 additions & 0 deletions
25
src/main/java/onlydust/com/marketplace/kernel/model/SponsorId.java
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 |
---|---|---|
@@ -0,0 +1,25 @@ | ||
package onlydust.com.marketplace.kernel.model; | ||
|
||
import lombok.EqualsAndHashCode; | ||
import lombok.NoArgsConstructor; | ||
import lombok.NonNull; | ||
import lombok.experimental.SuperBuilder; | ||
|
||
import java.util.UUID; | ||
|
||
@NoArgsConstructor(staticName = "random") | ||
@EqualsAndHashCode(callSuper = true) | ||
@SuperBuilder | ||
public class SponsorId extends UuidWrapper { | ||
public static SponsorId of(@NonNull final UUID uuid) { | ||
return SponsorId.builder().uuid(uuid).build(); | ||
} | ||
|
||
public static SponsorId of(@NonNull final String uuid) { | ||
return SponsorId.of(UUID.fromString(uuid)); | ||
} | ||
|
||
public String pretty() { | ||
return "#" + this.value().toString().substring(0, 5).toUpperCase(); | ||
} | ||
} |
21 changes: 21 additions & 0 deletions
21
src/main/java/onlydust/com/marketplace/kernel/model/UserId.java
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 |
---|---|---|
@@ -0,0 +1,21 @@ | ||
package onlydust.com.marketplace.kernel.model; | ||
|
||
import lombok.EqualsAndHashCode; | ||
import lombok.NoArgsConstructor; | ||
import lombok.NonNull; | ||
import lombok.experimental.SuperBuilder; | ||
|
||
import java.util.UUID; | ||
|
||
@NoArgsConstructor(staticName = "random") | ||
@EqualsAndHashCode(callSuper = true) | ||
@SuperBuilder | ||
public class UserId extends UuidWrapper { | ||
public static UserId of(@NonNull final UUID uuid) { | ||
return UserId.builder().uuid(uuid).build(); | ||
} | ||
|
||
public static UserId of(@NonNull final String uuid) { | ||
return UserId.of(UUID.fromString(uuid)); | ||
} | ||
} |