Skip to content

Commit

Permalink
Remove redundant boolean
Browse files Browse the repository at this point in the history
  • Loading branch information
ullenius authored and Johannestegner committed Jun 25, 2020
1 parent c9613ac commit ec15236
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions src/main/java/dev/personnummer/Personnummer.java
Original file line number Diff line number Diff line change
Expand Up @@ -49,14 +49,13 @@ public static Personnummer parse(String personnummer) throws PersonnummerExcepti
private final String numbers;
private final String controlNumber;
private final boolean isMale;
private final boolean isFemale;

public Boolean isMale() {
public boolean isMale() {
return this.isMale;
}

public Boolean isFemale() {
return this.isFemale;
public boolean isFemale() {
return !isMale();
}

public String separator() {
Expand Down Expand Up @@ -143,7 +142,6 @@ public Personnummer(String personnummer, Options options) throws PersonnummerExc
this.controlNumber = matches.group(7);

this.isMale = Integer.parseInt(Character.toString(this.numbers.charAt(2))) % 2 == 1;
this.isFemale = !this.isMale;

// The format passed to Luhn method is supposed to be YYmmDDNNN
// Hence all numbers that are less than 10 (or in last case 100) will have leading 0's added.
Expand Down

0 comments on commit ec15236

Please sign in to comment.