Skip to content

Commit

Permalink
Create javadoc for isValidIc
Browse files Browse the repository at this point in the history
  • Loading branch information
ryanlimdx committed Apr 5, 2024
1 parent 7f1ecf9 commit d9d27e8
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/main/java/seedu/address/model/person/Ic.java
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ public class Ic {

// Singapore regex for ic
public static final String VALIDATION_REGEX = "^[A-Z]\\d{7}[A-Z]$";

public final String value;

/**
Expand All @@ -25,6 +26,10 @@ public Ic(String value) {
checkArgument(isValidIc(value), MESSAGE_CONSTRAINTS);
this.value = value;
}

/**
* Returns true if a given string is a valid IC.
*/
public static boolean isValidIc(String ic) {
return ic.matches(VALIDATION_REGEX);
}
Expand Down

0 comments on commit d9d27e8

Please sign in to comment.