private static Filter filter(RoiOptions opts) { Filter f = new Filter(); if (opts != null) { if (opts.userId != null) { f.owner(opts.userId.getValue()); } if (opts.groupId != null) { f.group(opts.groupId.getValue()); } Integer offset = null; Integer limit = null; if (opts.offset != null) { offset = opts.offset.getValue(); } if (opts.limit != null) { limit = opts.limit.getValue(); } if (offset != null || limit != null) { f.page(offset, limit); } } return f; }
public static ome.parameters.Filter convert(Filter f) { if (f == null) { return null; } ome.parameters.Filter filter = new ome.parameters.Filter(); if (f.offset != null) { filter.offset = f.offset.getValue(); } if (f.limit != null) { filter.limit = f.limit.getValue(); } if (f.ownerId != null) { filter.owner(f.ownerId.getValue()); } if (f.groupId != null) { filter.group(f.groupId.getValue()); } if (f.startTime != null) { filter.startTime = convert(f.startTime); } if (f.endTime != null) { filter.endTime = convert(f.endTime); } if (f.unique != null && f.unique.getValue()) { filter.unique(); } return filter; }
/** * In order to support the order() method in addition * to a filter, we allow applying the filter and nulling * the instance eagerly before the user calls order. */ public QueryBuilder filterNow() { if (filter != null && filterTarget != null) { if (filter.owner() >= 0) { this.and(filterTarget+".details.owner.id = "); String alias = this.unique_alias("owner"); this.append(":"); this.append(alias); this.param(alias, filter.owner()); appendSpace(); } if (filter.group() >= 0) { this.and(filterTarget+".details.group.id = "); String alias = this.unique_alias("group"); this.append(":"); this.append(alias); this.param(alias, filter.group()); appendSpace(); } } return this; }
public Parameters paginate(Integer offset, Integer limit) { if (this.filter == null) { this.filter = new Filter(); } this.filter.limit = limit; this.filter.offset = offset; return this; }
public boolean isGroup() { if (this.filter != null) { return this.filter.group() != -1L; } return false; }
public long owner() { if (this.filter != null) { return this.filter.owner(); } return -1; }
public boolean isUnique() { if (this.filter != null) { return this.filter.isUnique(); } return false; }
public Parameters startTime(Timestamp timestamp) { if (this.filter == null) { this.filter = new Filter(); } this.filter.startTime = timestamp; return this; }
public long group() { if (this.filter != null) { return this.filter.group(); } return -1; }
public boolean isExperimenter() { if (this.filter != null) { return this.filter.owner() != -1L; } return false; }
public Parameters endTime(Timestamp timestamp) { if (this.filter == null) { this.filter = new Filter(); } this.filter.endTime = timestamp; return this; }
public Parameters page(Integer offset, Integer limit) { if (this.filter == null) { this.filter = new Filter(); } this.filter.limit = limit; this.filter.offset = offset; return this; }