/** * Analyzes a fulltext query into a generic datastructure that can be used for each specific database. * <p> * List of terms containing only negative words are suppressed. Otherwise negative words are put at the end of the * lists of terms. */ public static FulltextQuery analyzeFulltextQuery(String query) { return new FulltextQueryAnalyzer().analyze(query); }
/** * Adds a flattened version of all toplevel ANDed WHERE clauses. */ protected void addWhere(List<Predicate> clauses, WhereClause where) { if (where != null) { addWhere(clauses, where.predicate); } }
/** * Makes a deep copy of a {@link State} map, optionally thread-safe. * * @param threadSafe if {@code true}, then thread-safe datastructures are used */ public static State deepCopy(State state, boolean threadSafe) { State copy = new State(state.size(), threadSafe); for (Entry<String, Serializable> en : state.entrySet()) { copy.put(en.getKey(), deepCopy(en.getValue(), threadSafe)); } return copy; }
public Boolean walkOr(Operand lvalue, Operand rvalue) { Boolean left = bool(walkOperand(lvalue)); Boolean right = bool(walkOperand(rvalue)); return or(left, right); }
public boolean getFulltextSearchDisabled() { if (getFulltextDisabled()) { return true; } return defaultFalse(fulltextSearchDisabled); }
@Override public Object[] getArray(String name) { Serializable object = get(name); if (object == null) { return null; } else if (object instanceof Object[]) { return (Object[]) object; } else { // data migration not done in database, return an array anyway return new Object[] { object }; } }
/** * Makes a deep copy of a value. */ public static Serializable deepCopy(Object value) { return deepCopy(value, false); }
protected String stringToText(String string) { string = removeHtml(string); string = removeEntities(string); return string; }
public Boolean walkLt(Operand lvalue, Operand rvalue) { Integer cmp = cmp(lvalue, rvalue); return cmp == null ? null : cmp < 0; }
protected void setBlobInfo(T state, BlobInfo blobInfo) throws PropertyException { state.setSingle(BLOB_DATA, blobInfo.key); state.setSingle(BLOB_NAME, blobInfo.filename); state.setSingle(BLOB_MIME_TYPE, blobInfo.mimeType); state.setSingle(BLOB_ENCODING, blobInfo.encoding); state.setSingle(BLOB_DIGEST, blobInfo.digest); state.setSingle(BLOB_LENGTH, blobInfo.length); }
@Override public void put(String key, Serializable value) { // for a StateDiff, we don't have concurrency problems // and we want to store nulls explicitly putEvenIfNull(key, value); } }
@Override public boolean equals(Object other) { return StateHelper.equalsStrict(this, other); }
@Override public WriteContext getWriteContext() { return new BlobWriteContext<T>(); }
@Override public boolean equals(Object other) { if (other == this) { return true; } if (other instanceof Credentials) { return equals((Credentials) other); } return false; }
public FulltextExtractorWork(String repositoryName, String docId, boolean updateSimpleText, boolean updateBinaryText, boolean useJobId) { super(); // random id, for unique job setDocument(repositoryName, docId); this.updateSimpleText = updateSimpleText; this.updateBinaryText = updateBinaryText; this.useJobId = useJobId; }
@Override public Entry<String, Serializable> next() { return new ArraysEntry(index++); } }
/** * Makes a deep copy of a {@link List}. */ public static List<Serializable> deepCopy(List<Serializable> list) { return deepCopy(list, false); }
public Boolean walkGtEq(Operand lvalue, Operand rvalue) { Integer cmp = cmp(lvalue, rvalue); return cmp == null ? null : cmp >= 0; }
/** * Makes a deep copy of a {@link State} map. */ public static State deepCopy(State state) { return deepCopy(state, false); }