Skip to content

Commit 55080f9

Browse files
oschwaldclaude
andcommitted
Make AbstractLocation a sealed class
Seal AbstractLocation to explicitly declare its only permitted subclasses (Billing and Shipping). This makes the type hierarchy more explicit and enables better pattern matching and exhaustiveness checking in Java 17+. Note: MinFraudException was already using sealed classes. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
1 parent 6c42ded commit 55080f9

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/main/java/com/maxmind/minfraud/request/AbstractLocation.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@
77
/**
88
* This class represents the shared location behavior between Billing and Shipping.
99
*/
10-
public abstract class AbstractLocation extends AbstractModel {
10+
public abstract sealed class AbstractLocation extends AbstractModel
11+
permits Billing, Shipping {
1112
private final String firstName;
1213
private final String lastName;
1314
private final String company;

0 commit comments

Comments
 (0)