public TextP clone() { return (TextP) super.clone(); }
public HasContainer clone() { try { final HasContainer clone = (HasContainer) super.clone(); clone.predicate = this.predicate.clone(); return clone; } catch (final CloneNotSupportedException e) { throw new IllegalStateException(e.getMessage(), e); } }
@Override public IsStep<S> clone() { final IsStep<S> clone = (IsStep<S>) super.clone(); clone.predicate = this.predicate.clone(); return clone; }
@Override public WherePredicateStep<S> clone() { final WherePredicateStep<S> clone = (WherePredicateStep<S>) super.clone(); clone.predicate = this.predicate.clone(); clone.traversalRing = this.traversalRing.clone(); return clone; }
public TextP clone() { return (TextP) super.clone(); }
public HasContainer clone() { try { final HasContainer clone = (HasContainer) super.clone(); clone.predicate = this.predicate.clone(); return clone; } catch (final CloneNotSupportedException e) { throw new IllegalStateException(e.getMessage(), e); } }
@Override public IsStep<S> clone() { final IsStep<S> clone = (IsStep<S>) super.clone(); clone.predicate = this.predicate.clone(); return clone; }
@Override public WherePredicateStep<S> clone() { final WherePredicateStep<S> clone = (WherePredicateStep<S>) super.clone(); clone.predicate = this.predicate.clone(); clone.traversalRing = this.traversalRing.clone(); return clone; }
private PredicatesHolder stringValueToPredicate(String value, HasContainer has, boolean collection) { String[] values = value.split(delimiter); if (values.length < schemas.size()) return PredicatesHolderFactory.abort(); Set<PredicatesHolder> predicates = new HashSet<>(); for (int i = 0; i < schemas.size(); i++) { P predicate = has.getPredicate().clone(); final Object currentValue = values[i]; P p = new P(predicate.getBiPredicate(), collection ? Arrays.asList(currentValue) : currentValue); PredicatesHolder predicatesHolder = schemas.get(i).toPredicates(PredicatesHolderFactory.predicate(new HasContainer(has.getKey(), p))); predicates.add(predicatesHolder); } return PredicatesHolderFactory.and(predicates); }
@Override public PredicatesHolder toPredicate(HasContainer has) { P predicate; if (has != null && !test(has.getPredicate())) { return PredicatesHolderFactory.abort(); } else if (has != null) { predicate = has.getPredicate().clone(); if (reverseAlias != null) { Object predicateValue = predicate.getValue(); if (reverseAlias.containsKey(predicateValue.toString())){ predicate.setValue(reverseAlias.get(predicateValue.toString())); } } } else if (include != null) { predicate = P.within(include); } else if (exclude != null) { predicate = P.without(exclude); } else return PredicatesHolderFactory.empty(); P translatedPredicate = type.translate(predicate); HasContainer hasContainer = new HasContainer(this.field, translatedPredicate); return PredicatesHolderFactory.predicate(hasContainer); }
@Override public PredicatesHolder toPredicate(HasContainer has) { if (has.getPredicate() instanceof ConnectiveP) { List<P> predicates = ((ConnectiveP) has.getPredicate()).getPredicates(); predicates.forEach(p -> { Object dateValue = p.getValue(); Date parsedDate = fromDisplay(dateValue.toString()); String formattedDate = toSource(parsedDate); p.setValue(formattedDate); }); return PredicatesHolderFactory .predicate(new HasContainer(this.field, has.getPredicate())); } Object dateValue = has.getValue(); Date parsedDate = fromDisplay(dateValue.toString()); String formattedDate = toSource(parsedDate); P predicated = has.getPredicate().clone(); predicated.setValue(formattedDate); return PredicatesHolderFactory.predicate(new HasContainer(this.field, predicated)); }