Пример #1
0
  private boolean hasTypeDiscriminatorFieldOrMethod(final Class<?> persistentType) {
    Collection<?> hits =
        eachField(
            persistentType,
            new Predicate<Field>() {
              public boolean apply(Field input) {
                return hasAnnotation(input, TypeDiscriminator.class);
              }
            });
    if (!hits.isEmpty()) {
      return true;
    }

    hits =
        eachMethod(
            persistentType,
            new Predicate<Method>() {
              public boolean apply(Method input) {
                return hasAnnotation(input, TypeDiscriminator.class);
              }
            });
    return !hits.isEmpty();
  }
Пример #2
0
 public static Keys of(Collection<?> keys) {
   return new Keys(keys.toArray());
 }