The IPAddress.from() static method could have an additional argument to indicate whether to automatically resolve mapped addresses, for example:
IPAddress.from("::ffff:192.0.2.0"); // IPv6 { getMappedIPv4(): IPv4 { toString(): "192.0.2.0" } }
IPAddress.from("::ffff:192.0.2.0", true); // IPv4 { toString(): "192.0.2.0" }