@Override public Class<?> getReturnedDomainClass(final Method method) { if (ArangoCursor.class.isAssignableFrom(method.getReturnType())) { return typeInformation.getReturnType(method).getRequiredComponentType().getType(); } else { return super.getReturnedDomainClass(method); } }
@Override public Class<?> getReturnedDomainClass(final Method method) { if (ArangoCursor.class.isAssignableFrom(method.getReturnType())) { return typeInformation.getReturnType(method).getRequiredComponentType().getType(); } else { return super.getReturnedDomainClass(method); } }
@Override public Class<?> getReturnedDomainClass(final Method method) { if (ArangoCursor.class.isAssignableFrom(method.getReturnType())) { return typeInformation.getReturnType(method).getRequiredComponentType().getType(); } else { return super.getReturnedDomainClass(method); } }
private static Optional<Method> findWither(TypeInformation<?> owner, String propertyName, Class<?> rawType) { AtomicReference<Method> resultHolder = new AtomicReference<>(); String methodName = String.format("with%s", StringUtils.capitalize(propertyName)); ReflectionUtils.doWithMethods(owner.getType(), it -> { if (owner.isAssignableFrom(owner.getReturnType(it))) { resultHolder.set(it); } }, it -> isMethodWithSingleParameterOfType(it, methodName, rawType)); Method method = resultHolder.get(); return method != null ? Optional.of(method) : Optional.empty(); }
@Override public Class<?> getReturnedDomainClass(final Method method) { if (ArangoCursor.class.isAssignableFrom(method.getReturnType())) { return typeInformation.getReturnType(method).getRequiredComponentType().getType(); } else { return super.getReturnedDomainClass(method); } }
public Class<?> getReturnedDomainClass(Method method) { return QueryExecutionConverters.unwrapWrapperTypes(typeInformation.getReturnType(method)).getType(); }
public Class<?> getReturnedDomainClass(Method method) { TypeInformation<?> returnTypeInfo = typeInformation.getReturnType(method); Class<?> rawType = returnTypeInfo.getType(); return Iterable.class.isAssignableFrom(rawType) ? returnTypeInfo.getComponentType().getType() : rawType; } }
private Property(TypeInformation<?> type, Optional<Field> field, Optional<PropertyDescriptor> descriptor) { Assert.notNull(type, "Type must not be null!"); Assert.isTrue(Optionals.isAnyPresent(field, descriptor), "Either field or descriptor has to be given!"); this.field = field; this.descriptor = descriptor; this.rawType = withFieldOrDescriptor( // it -> type.getRequiredProperty(it.getName()).getType(), // it -> type.getRequiredProperty(it.getName()).getType() // ); this.hashCode = Lazy.of(() -> withFieldOrDescriptor(Object::hashCode)); this.name = Lazy.of(() -> withFieldOrDescriptor(Field::getName, FeatureDescriptor::getName)); this.toString = Lazy.of(() -> withFieldOrDescriptor(Object::toString, it -> String.format("%s.%s", type.getType().getName(), it.getDisplayName()))); this.getter = descriptor.map(PropertyDescriptor::getReadMethod)// .filter(it -> getType() != null)// .filter(it -> getType().isAssignableFrom(type.getReturnType(it).getType())); this.setter = descriptor.map(PropertyDescriptor::getWriteMethod)// .filter(it -> getType() != null)// .filter(it -> type.getParameterTypes(it).get(0).getType().isAssignableFrom(getType())); this.wither = Lazy.of(() -> findWither(type, getName(), getType())); }