Improve implementation and testing on PNP contact merging.

This commit is contained in:
Greyson Parrelli
2022-06-29 15:29:58 -04:00
committed by Cody Henthorne
parent c64be82710
commit 61ce39b5b6
8 changed files with 1455 additions and 74 deletions

View File

@@ -16,6 +16,14 @@ public final class ACI extends ServiceId {
return new ACI(uuid);
}
public static ACI from(ServiceId serviceId) {
return new ACI(serviceId.uuid());
}
public static ACI fromNullable(ServiceId serviceId) {
return serviceId != null ? new ACI(serviceId.uuid()) : null;
}
public static ACI parseOrThrow(String raw) {
return from(UUID.fromString(raw));
}

View File

@@ -17,6 +17,10 @@ public final class Preconditions {
}
}
public static void checkState(boolean state) {
checkState(state, "Condition must be true!");
}
public static void checkState(boolean state, String message) {
if (!state) {
throw new IllegalStateException(message);