Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,11 @@ public EmailAddress(@Nullable String value) {
this.value = value.toLowerCase();
}

@SuppressWarnings("unused")
EmailAddress(EmailAddress other) {
this(other.value);
}

@Override
public String toString() {
return value;
Expand Down
5 changes: 5 additions & 0 deletions src/main/java/it/aboutbits/springboot/toolbox/type/Iban.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,11 @@ public Iban(@Nullable String value) {
this.value = value.toUpperCase();
}

@SuppressWarnings("unused")
Iban(Iban other) {
this(other.value);
}

@Override
public String toString() {
return value;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,11 @@ public record ScaledBigDecimal(
public static final ScaledBigDecimal TWO = new ScaledBigDecimal(2);
public static final ScaledBigDecimal TEN = new ScaledBigDecimal(10);

@SuppressWarnings("unused")
ScaledBigDecimal(ScaledBigDecimal other) {
this(other.value);
}

public ScaledBigDecimal(BigDecimal value) {
this.value = value.setScale(MATH_CONTEXT.getPrecision(), MATH_CONTEXT.getRoundingMode());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ void invalidValues_shouldFail(String value) {
void null_shouldFail() {
//noinspection DataFlowIssue
assertThatIllegalArgumentException().isThrownBy(
() -> new EmailAddress(null)
() -> new EmailAddress((String) null)
);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ void invalidValues_shouldFail(String value) {
void null_shouldFail() {
//noinspection DataFlowIssue
assertThatIllegalArgumentException().isThrownBy(
() -> new Iban(null)
() -> new Iban((String) null)
);
}
}
Expand Down