mirror of
https://github.com/google/nomulus
synced 2026-09-02 14:17:12 +00:00
Implement input for MRs over child entities
Also throwing in a proof-of-concept MR that I'd like to run in production, and then scrap once the meaty MR is finished (e.g. exploding Recurring billing events into OneTimes). ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=119881471
This commit is contained in:
@@ -15,11 +15,13 @@
|
||||
package com.google.domain.registry.util;
|
||||
|
||||
import static com.google.common.base.Preconditions.checkArgument;
|
||||
import static com.google.domain.registry.util.CollectionUtils.difference;
|
||||
import static java.lang.reflect.Modifier.isFinal;
|
||||
import static java.lang.reflect.Modifier.isStatic;
|
||||
|
||||
import com.google.common.base.Predicate;
|
||||
import com.google.common.collect.ImmutableMap;
|
||||
import com.google.common.collect.ImmutableSet;
|
||||
import com.google.common.reflect.TypeToken;
|
||||
|
||||
import java.lang.annotation.Annotation;
|
||||
@@ -88,4 +90,16 @@ public class TypeUtils {
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
public static void checkNoInheritanceRelationships(ImmutableSet<Class<?>> resourceClasses) {
|
||||
for (Class<?> resourceClass : resourceClasses) {
|
||||
for (Class<?> potentialSuperclass : difference(resourceClasses, resourceClass)) {
|
||||
checkArgument(
|
||||
!potentialSuperclass.isAssignableFrom(resourceClass),
|
||||
"Cannot specify resource classes with inheritance relationship: %s extends %s",
|
||||
resourceClass,
|
||||
potentialSuperclass);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user