Skip to content

Commit

Permalink
Added company field to CFP Speaker
Browse files Browse the repository at this point in the history
  • Loading branch information
mklaehn authored and svenreimers committed Sep 13, 2023
1 parent 15ae83c commit a949ea8
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
* The MIT License (MIT)
*
* Copyright (c) 2022 TweetWallFX
* Copyright (c) 2022-2023 TweetWallFX
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
Expand Down Expand Up @@ -53,6 +53,11 @@ public interface Speaker extends Identifiable, Avatar {
*/
String getLastName();

/**
* {@return the company name of this speaker}
*/
Optional<String> getCompany();

/**
* Returns the social media ids of this speaker.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ public final class SpeakerImpl implements Speaker {
private final String firstName;
private final String fullName;
private final String lastName;
private final Optional<String> company;
private final String avatarURL;
private final Map<String, String> socialMedia;
private final List<Talk> talks;
Expand All @@ -53,6 +54,7 @@ private SpeakerImpl(final Builder builder) {
this.firstName = Objects.requireNonNull(builder.firstName, "firstName must not be null");
this.fullName = Objects.requireNonNull(builder.fullName, "fullName must not be null");
this.lastName = Objects.requireNonNull(builder.lastName, "lastName must not be null");
this.company = Optional.ofNullable(builder.company);
this.avatarURL = Objects.requireNonNull(builder.avatarURL, "avatarURL must not be null");
this.socialMedia = Map.copyOf(builder.socialMedia);
this.talks = List.copyOf(builder.talks);
Expand Down Expand Up @@ -88,6 +90,11 @@ public String getId() {
return id;
}

@Override
public Optional<String> getCompany() {
return company;
}

@Override
public String getAvatarURL() {
return avatarURL;
Expand All @@ -105,6 +112,7 @@ public String toString() {
"firstName", getFirstName(),
"fullName", getFullName(),
"lastName", getLastName(),
"company", getCompany(),
"avatarURL", getAvatarURL(),
"socialMedia", getSocialMedia(),
"talks", getTalks()
Expand All @@ -125,6 +133,7 @@ public static final class Builder {
private Map<String, String> socialMedia = new TreeMap<>();
private List<Talk> talks = new ArrayList<>();
private String id;
private String company;
private String avatarURL;

private Builder() {
Expand Down Expand Up @@ -162,6 +171,11 @@ public Builder withLastName(final String lastName) {
return this;
}

public Builder withCompany(final String company) {
this.company = company;
return this;
}

public Builder withAvatarURL(final String avatarURL) {
this.avatarURL = Objects.requireNonNull(avatarURL, "avatarURL must not be null");
return this;
Expand Down

0 comments on commit a949ea8

Please sign in to comment.