@Override public PrismReferenceValueImpl cloneComplex(CloneStrategy strategy) { PrismReferenceValueImpl clone = new PrismReferenceValueImpl(getOid(), getOriginType(), getOriginObject()); copyValues(strategy, clone); return clone; }
@Override public void applyDefinition(ItemDefinition definition, boolean force) throws SchemaException { if (!(definition instanceof PrismReferenceDefinition)) { throw new IllegalArgumentException("Cannot apply "+definition+" to a reference value"); } applyDefinition((PrismReferenceDefinition)definition, force); }
@SuppressWarnings("unchecked") @Nullable @Override public Referencable getRealValue() { return asReferencable(); }
@Override public boolean equals(Object obj) { if (this == obj) return true; if (!super.equals(obj)) return false; if (getClass() != obj.getClass()) return false; PrismReferenceValue other = (PrismReferenceValue) obj; return equals(other, getEqualsHashCodeStrategy()); }
@Override public Object find(ItemPath path) { if (path == null || path.isEmpty()) { return this; } Object first = path.first(); if (!ItemPath.isName(first)) { throw new IllegalArgumentException("Attempt to resolve inside the reference value using a non-name path "+path+" in "+this); } ItemName subName = ItemPath.toName(first); if (compareLocalPart(F_OID, subName)) { return this.getOid(); } else if (compareLocalPart(F_TYPE, subName)) { return this.getTargetType(); } else if (compareLocalPart(F_RELATION, subName)) { return this.getRelation(); } else { throw new IllegalArgumentException("Attempt to resolve inside the reference value using a unrecognized path "+path+" in "+this); } }
public AbstractRoleType ownerRef(String oid, QName type) { PrismReferenceValue refVal = new PrismReferenceValueImpl(oid, type); ObjectReferenceType ort = new ObjectReferenceType(); ort.setupReferenceValue(refVal); return ownerRef(ort); }
public void setDescription(String description) { checkMutability(); this.description = description; }
/** * @param targetType * @param allowEmptyNamespace This is an ugly hack. See comment in DOMUtil.validateNonEmptyQName. */ public void setTargetType(QName targetType, boolean allowEmptyNamespace) { checkMutability(); // Null value is OK if (targetType != null) { // But non-empty is not .. Itemable item = getParent(); DOMUtil.validateNonEmptyQName(targetType, " in target type in reference "+ (item == null ? "(unknown)" : item.getElementName()), allowEmptyNamespace); } this.targetType = targetType; }
@Override public PrismReferenceValueImpl clone() { return cloneComplex(CloneStrategy.LITERAL); }
@Override public String debugDump(int indent) { return debugDump(indent, false); }
public boolean equals(PrismValue other, @NotNull ParameterizedEquivalenceStrategy strategy) { return other instanceof PrismReferenceValue && equals((PrismReferenceValue) other, strategy); }
public AbstractRoleType personaRef(String oid, QName type) { PrismReferenceValue refVal = new PrismReferenceValueImpl(oid, type); ObjectReferenceType ort = new ObjectReferenceType(); ort.setupReferenceValue(refVal); return personaRef(ort); }
public void setResolutionTime(EvaluationTimeType resolutionTime) { checkMutability(); this.resolutionTime = resolutionTime; }
public EvaluatedModificationTriggerType directOwnerRef(String oid, QName type) { PrismReferenceValue refVal = new PrismReferenceValueImpl(oid, type); ObjectReferenceType ort = new ObjectReferenceType(); ort.setupReferenceValue(refVal); return directOwnerRef(ort); }
public void setOid(String oid) { checkMutability(); this.oid = oid; }
public ArchetypeType tenantRef(String oid, QName type) { PrismReferenceValue refVal = new PrismReferenceValueImpl(oid, type); ObjectReferenceType ort = new ObjectReferenceType(); ort.setupReferenceValue(refVal); return tenantRef(ort); }
public void setObject(PrismObject object) { checkMutability(); this.object = object; }
public AssignmentHolderType roleMembershipRef(String oid, QName type) { PrismReferenceValue refVal = new PrismReferenceValueImpl(oid, type); ObjectReferenceType ort = new ObjectReferenceType(); ort.setupReferenceValue(refVal); return roleMembershipRef(ort); }
public void setFilter(SearchFilterType filter) { checkMutability(); this.filter = filter; }
public AbstractCredentialsResetPolicyType formRef(String oid, QName type) { PrismReferenceValue refVal = new PrismReferenceValueImpl(oid, type); ObjectReferenceType ort = new ObjectReferenceType(); ort.setupReferenceValue(refVal); return formRef(ort); }