Skip to content

Commit

Permalink
Introduce active flag (#340)
Browse files Browse the repository at this point in the history
  • Loading branch information
sven1103 authored Nov 16, 2022
1 parent 5d32fb9 commit 3813d45
Showing 1 changed file with 20 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,12 @@ final class Affiliation {
*/
final AffiliationLabel label

/**
* Boolean flag if an affiliation is active
* @since 2.23.0
*/
final Boolean active

static class Builder {

int id
Expand All @@ -86,6 +92,8 @@ final class Affiliation {

AffiliationLabel label

Boolean active

Builder(String organisation, String street, String postalCode, String city) {
this.id = id
this.organisation = organisation
Expand All @@ -96,6 +104,7 @@ final class Affiliation {
this.country = "Germany"
this.category = AffiliationCategory.EXTERNAL
this.label = AffiliationLabel.MNF
this.active = Boolean.TRUE
}

Builder id(int id) {
Expand Down Expand Up @@ -128,6 +137,16 @@ final class Affiliation {
return this
}

Builder setInactive() {
this.active = Boolean.FALSE
return this
}

Builder setActive() {
this.active = Boolean.TRUE
return this
}


Affiliation build() {
return new Affiliation(this)
Expand All @@ -145,6 +164,7 @@ final class Affiliation {
this.category = builder.category
this.city = builder.city
this.label = builder.label
this.active = builder.active
}

@Override
Expand Down

0 comments on commit 3813d45

Please sign in to comment.