Move assert

Signed-off-by: TheMode <themode@outlook.fr>
This commit is contained in:
TheMode 2022-04-07 11:35:09 +02:00
parent 031d9253a3
commit 60d22929a1
2 changed files with 1 additions and 2 deletions

View File

@ -269,13 +269,11 @@ public class Tag<T> {
@ApiStatus.Experimental
public static <T extends Record> @NotNull Tag<T> Structure(@NotNull String key, @NotNull Class<T> type) {
assert type.isRecord();
return Structure(key, TagRecord.serializer(type));
}
@ApiStatus.Experimental
public static <T extends Record> @NotNull Tag<T> View(@NotNull Class<T> type) {
assert type.isRecord();
return View(TagRecord.serializer(type));
}
}

View File

@ -59,6 +59,7 @@ final class TagRecord {
};
static <T extends Record> @NotNull Serializer<T> serializer(@NotNull Class<T> type) {
assert type.isRecord();
//noinspection unchecked
return (Serializer<T>) serializers.get(type);
}