-
Notifications
You must be signed in to change notification settings - Fork 13
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
d122995
commit 92f458e
Showing
6 changed files
with
100 additions
and
19 deletions.
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
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
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
18 changes: 18 additions & 0 deletions
18
src/main/java/com/openelements/issues/data/Repository.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 |
---|---|---|
@@ -1,7 +1,25 @@ | ||
package com.openelements.issues.data; | ||
|
||
import java.util.List; | ||
import java.util.Objects; | ||
import org.jspecify.annotations.NonNull; | ||
|
||
public record Repository(@NonNull String org, @NonNull String name, @NonNull String imageUrl, @NonNull List<String> languages) { | ||
|
||
|
||
|
||
public Repository(@NonNull String org, @NonNull String name, @NonNull String imageUrl, @NonNull List<String> languages) { | ||
this.org = Objects.requireNonNull(org, "org must not be null"); | ||
this.name = Objects.requireNonNull(name, "name must not be null"); | ||
this.imageUrl = Objects.requireNonNull(imageUrl, "imageUrl must not be null"); | ||
Objects.requireNonNull(languages, "languages must not be null"); | ||
this.languages = List.copyOf(languages); | ||
|
||
if (org.isBlank()) { | ||
throw new IllegalArgumentException("org is required"); | ||
} | ||
if (name.isBlank()) { | ||
throw new IllegalArgumentException("name is required"); | ||
} | ||
} | ||
} |
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
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