private void serialize(SimpleCriteria matchCriteria, ObjectOutputStream out) throws IOException { writeLong(out, matchCriteria.getFromPk()); writeDate(out, matchCriteria.getFromDate()); writeDate(out, matchCriteria.getUntilDate()); writeDate(out, matchCriteria.getCreationTimestampFrom()); writeDate(out, matchCriteria.getCreationTimestampUntil()); writeStringArray(out, matchCriteria.getTypes()); writeStringArray(out, matchCriteria.getTags()); writeStringArray(out, matchCriteria.getTagPrefixes()); }
/** * Copies the criteria with possibly modified types setting. * * @param types the new value for the criterion * @return the new criteria */ public MatchCriteria types(String... types) { MatchCriteria r = new MatchCriteria(this); r.types = types; return r; }
private SimpleCriteria deserialize(ObjectInputStream objectInputStream) throws IOException, ClassNotFoundException { SimpleCriteria criteria; criteria = new SimpleCriteria(); criteria.setFromPk(readLong(objectInputStream)); criteria.setFromDate(readDate(objectInputStream)); criteria.setUntilDate(readDate(objectInputStream)); criteria.setCreationTimestampFrom(readDate(objectInputStream)); criteria.setCreationTimestampUntil(readDate(objectInputStream)); criteria.setTypes(readStringArray(objectInputStream)); criteria.setTags(readStringArray(objectInputStream)); criteria.setTagPrefixes(readStringArray(objectInputStream)); return criteria; }
private String createToken(SimpleCriteria criteria, Long lastTimestamp, Long lastPk) { if (lastTimestamp == null) { return null; } SimpleCriteria nextCriteria = new SimpleCriteria(criteria); nextCriteria.setFromDate(new Date(lastTimestamp)); nextCriteria.setFromPk(lastPk); return criteriaSerializator.serialize(nextCriteria); }
/** * Copies the criteria with possibly modified tags setting. * * @param tags the new value for the criterion * @return the new criteria */ public MatchCriteria tags(String... tags) { MatchCriteria r = new MatchCriteria(this); r.tags = simpleTagsConjunction(tags); return r; }
public String[] getTags() { return nullSafe(tags); }
public SimpleCriteria(SimpleCriteria crit) { this.types = copy(crit.types); this.tags = copy(crit.tags); this.tagPrefixes = copy(crit.tagPrefixes); this.fromDate = crit.fromDate; this.fromPk = crit.fromPk; this.untilDate = crit.untilDate; this.creationTimestampFrom = crit.creationTimestampFrom; this.creationTimestampUntil = crit.creationTimestampUntil; }
private void writeStringArray(ObjectOutputStream out, String[] stringsArray) throws IOException { Long length; length = (stringsArray == null ? null : (long)stringsArray.length); writeLong(out, length); if (stringsArray != null) { for (String string : stringsArray) { out.writeUTF(string); } } }
/** * Copies the criteria with possibly modified usePartStamps setting. * * @param usePartStamps the new value for the criterion * @return the new criteria */ public MatchCriteria usingPartStamps(boolean usePartStamps) { MatchCriteria r = new MatchCriteria(this); r.usePartStamps = usePartStamps; return r; }
/** * Copies the criteria with possibly modified tags setting. * * @param tags the new value for the criterion * @return the new criteria */ public MatchCriteria tags(Collection<String> tags) { MatchCriteria r = new MatchCriteria(this); r.tags = simpleTagsConjunction(tags.toArray(new String[tags.size()])); return r; }
public String[] getTagPrefixes() { return nullSafe(tagPrefixes); }
/** * Copies the criteria with possibly modified partSearchKey setting. * * @param psk the new value for the criterion * @return the new criteria */ public MatchCriteria partSearchKey(PartSearchKey psk) { MatchCriteria r = new MatchCriteria(this); r.psk = psk; return r; }
public String[] getTypes() { return nullSafe(types); }
/** * Copies the criteria with possibly modified tag prefixes setting. * * @param tagPrefixes the new value for the criterion * @return the new criteria */ public MatchCriteria tagPrefixes(String... tagPrefixes) { MatchCriteria r = new MatchCriteria(this); r.tagPrefixes = tagPrefixes; return r; }
/** * Copies the criteria with possibly modified until setting. * * @param creationTimestampFrom the new value for the criterion * @return the new criteria */ public MatchCriteria creationTimestampFrom(Date creationTimestampFrom) { MatchCriteria r = new MatchCriteria(this); r.creationTimestampFrom = creationTimestampFrom; return r; }
/** * Copies the criteria with possibly modified until setting. * * @param creationTimestampUntil the new value for the criterion * @return the new criteria */ public MatchCriteria creationTimestampUntil(Date creationTimestampUntil) { MatchCriteria r = new MatchCriteria(this); r.creationTimestampUntil = creationTimestampUntil; return r; }
/** * Copies the criteria with possibly modified tags setting. * * @param tags the new value for the criterion * @return the new criteria */ public MatchCriteria tagConstraint(String[][] tags) { MatchCriteria r = new MatchCriteria(this); r.tags = tags; return r; }
/** * Copies the criteria with possibly modified from setting. * * @param from the new value for the criterion * @return the new criteria */ public MatchCriteria from(Date from) { MatchCriteria r = new MatchCriteria(this); r.from = from; return r; }
/** * Copies the criteria with possibly modified until setting. * * @param until the new value for the criterion * @return the new criteria */ public MatchCriteria until(Date until) { MatchCriteria r = new MatchCriteria(this); r.until = until; return r; }
/** * Copies the criteria with possibly modified types setting. * * @param types the new value for the criterion * @return the new criteria */ public MatchCriteria types(Collection<String> types) { MatchCriteria r = new MatchCriteria(this); r.types = types.toArray(new String[types.size()]); return r; }