/** * @return {@literal true} if no arguments set. */ boolean isEmpty() { return !Optionals.isAnyPresent(getValidator(), getValidationAction(), getValidationLevel()); } }
/** * @return {@literal true} if no arguments set. */ boolean isEmpty() { return !Optionals.isAnyPresent(getValidator(), getValidationAction(), getValidationLevel()); } }
/** * Returns whether the {@link Class} represented in this instance is auditable or not. */ public boolean isAuditable() { return Optionals.isAnyPresent(createdByField, createdDateField, lastModifiedByField, lastModifiedDateField); }
/** * Returns whether the {@link Class} represented in this instance is auditable or not. */ public boolean isAuditable() { return Optionals.isAnyPresent(createdByField, createdDateField, lastModifiedByField, lastModifiedDateField); }
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())); }