@Override public String debugDump(int indent) { StringBuilder sb = new StringBuilder(); DebugUtil.indentDebugDump(sb, indent); sb.append("TYPE: "); sb.append(type.getLocalPart()); sb.append('\n'); if (filter != null) { sb.append(filter.debugDump(indent + 1)); } return sb.toString(); }
public static void assertPropertyOnly(ObjectFilter filter, final String message) { Visitor visitor = f -> { if (f instanceof OrgFilter) { if (message == null) { throw new IllegalArgumentException(f.toString()); } else { throw new IllegalArgumentException(message+": "+ f); } } }; filter.accept(visitor); }
@Override public void checkConsistence(boolean requireDefinitions) { if (type == null) { throw new IllegalArgumentException("Null type in "+this); } // null subfilter is legal. It means "ALL". if (filter != null) { filter.checkConsistence(requireDefinitions); } }
@Override public boolean match(PrismContainerValue value, MatchingRuleRegistry matchingRuleRegistry) throws SchemaException { for (ObjectFilter filter : getConditions()){ if (filter.match(value, matchingRuleRegistry)){ return true; } } return false; }
protected List<ObjectFilter> getClonedConditions() { if (conditions == null) { return null; } List<ObjectFilter> clonedConditions = new ArrayList<>(conditions.size()); for (ObjectFilter condition: conditions) { clonedConditions.add(condition.clone()); } return clonedConditions; }
@Override public boolean equals(Object o, boolean exact) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; TypeFilterImpl that = (TypeFilterImpl) o; if (!type.equals(that.type)) return false; if (filter != null ? !filter.equals(that.filter, exact) : that.filter != null) return false; return true; }
static <T extends Objectable> boolean match( PrismObject<T> object, ObjectFilter filter, MatchingRuleRegistry matchingRuleRegistry) throws SchemaException { return filter.match(object.getValue(), matchingRuleRegistry); }
@SuppressWarnings("CloneDoesntCallSuperClone") @Override public TypeFilterImpl clone() { ObjectFilter f = filter != null ? filter.clone() : null; return new TypeFilterImpl(type, f); }
public boolean equals(Object o, boolean exact) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; ObjectQueryImpl that = (ObjectQueryImpl) o; if (allowPartialResults != that.allowPartialResults) return false; if (filter != null ? !filter.equals(that.filter, exact) : that.filter != null) return false; return paging != null ? paging.equals(that.paging, exact) : that.paging == null; }
@Override public String debugDump(int indent) { StringBuilder sb = new StringBuilder(); DebugUtil.indentDebugDump(sb, indent); sb.append(getDebugDumpOperationName()).append(":"); for (ObjectFilter filter : getConditions()){ sb.append("\n"); sb.append(filter.debugDump(indent + 1)); } return sb.toString(); }
public void addRequiredItems(ObjectFilter filter) { filter.accept(visitable -> { if (visitable instanceof ItemFilter) { requiredItems.add(((ItemFilter)visitable).getFullPath()); } }); }
@Override public boolean match(PrismContainerValue value, MatchingRuleRegistry matchingRuleRegistry) throws SchemaException { for (ObjectFilter filter : getConditions()){ if (!filter.match(value, matchingRuleRegistry)) { return false; } } return true; }
public ObjectQueryImpl clone() { ObjectQueryImpl clone = cloneEmpty(); if (this.filter != null) { clone.filter = this.filter.clone(); } return clone; }
@Override public void checkConsistence(boolean requireDefinitions) { if (conditions == null) { throw new IllegalArgumentException("Null conditions in "+this); } if (conditions.isEmpty()) { throw new IllegalArgumentException("Empty conditions in "+this); } for (ObjectFilter condition: conditions) { if (condition == null) { throw new IllegalArgumentException("Null subfilter in "+this); } condition.checkConsistence(requireDefinitions); } }
@Override public boolean equals(Object o, boolean exact) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; ExistsFilterImpl that = (ExistsFilterImpl) o; if (!fullPath.equals(that.fullPath, exact)) return false; if (exact) { if (definition != null ? !definition.equals(that.definition) : that.definition != null) return false; } return filter != null ? filter.equals(that.filter, exact) : that.filter == null; }
@Override public String debugDump(int indent) { StringBuilder sb = new StringBuilder(); DebugUtil.indentDebugDump(sb, indent); sb.append("EXISTS: "); sb.append(fullPath); sb.append('\n'); DebugUtil.indentDebugDump(sb, indent + 1); sb.append("DEF: "); if (getDefinition() != null) { sb.append(getDefinition().toString()); } else { sb.append("null"); } sb.append("\n"); if (filter != null) { sb.append(filter.debugDump(indent + 1)); } return sb.toString(); }
public static void assertNotRaw(ObjectFilter filter, final String message) { Visitor visitor = f -> { if (f instanceof ValueFilter && ((ValueFilter) f).isRaw()) { if (message == null) { throw new IllegalArgumentException(f.toString()); } else { throw new IllegalArgumentException(message+": "+ f); } } }; filter.accept(visitor); }
@Override public boolean match(PrismContainerValue value, MatchingRuleRegistry matchingRuleRegistry) throws SchemaException { return !getFilter().match(value, matchingRuleRegistry); }
@SuppressWarnings("CloneDoesntCallSuperClone") @Override public ExistsFilterImpl clone() { ObjectFilter f = filter != null ? filter.clone() : null; return new ExistsFilterImpl(fullPath, definition, f); }
@Override public void checkConsistence(boolean requireDefinitions) { if (fullPath.isEmpty()) { throw new IllegalArgumentException("Null or empty path in "+this); } if (requireDefinitions && definition == null) { throw new IllegalArgumentException("Null definition in "+this); } // null subfilter is legal. It means "ALL". if (filter != null) { filter.checkConsistence(requireDefinitions); } }