Skip to content

Commit

Permalink
feat: added logoUrl atribute
Browse files Browse the repository at this point in the history
  • Loading branch information
MatheaGjerde committed Mar 24, 2026
1 parent d6ce272 commit 7680c99
Showing 1 changed file with 8 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,16 @@
*
* <p>
* An organization is identified by an organization number, a name,
* trust status, website Url, pre-approval status, and a textual description.
* trust status, website Url, pre-approval status, and a textual description,
* and a logo URL.
*
* <p>
* Instances are validated on creation:
* <ul>
* <li>orgNumber must be non-negative</li>
* <li>name and websiteUrl must not be null or blank</li>
* <li>description must not be null</li>
* <li>logoUrl may be null if no logo is available</li>
* </ul>
*/
public record Organization(
Expand All @@ -23,7 +25,8 @@ public record Organization(
boolean trusted,
String websiteUrl,
boolean isPreApproved,
String description) {
String description,
String logoUrl) {
/**
* Creates a new organization.
*
Expand All @@ -35,12 +38,13 @@ public record Organization(
* @param isPreApproved whether the organization is pre-approved
* @param description a textual description of the organization; must not be
* null
* @param logoUrl the URL to the organization's logo image; may be null
* @throws NullPointerException if name, websiteUrl or description is null
* @throws IllegalArgumentException if orgNumber is negative, or if name or
* websiteUrl is blank
*/
public Organization(int orgNumber, String name, boolean trusted, String websiteUrl, boolean isPreApproved,
String description) {
String description, String logoUrl) {
if (orgNumber < 0) {
throw new IllegalArgumentException("orgNumber cannot be negative");
}
Expand All @@ -50,6 +54,7 @@ public Organization(int orgNumber, String name, boolean trusted, String websiteU
this.websiteUrl = Objects.requireNonNull(websiteUrl, "websiteUrl cannot be null");
this.isPreApproved = isPreApproved;
this.description = Objects.requireNonNull(description, "description cannot be null");
this.logoUrl = logoUrl;

if (name.isBlank()) {
throw new IllegalArgumentException("name cannot be blank");
Expand Down

0 comments on commit 7680c99

Please sign in to comment.