Skip to content

Commit

Permalink
MidpointFunctions: added getStructuralArchetype(object)
Browse files Browse the repository at this point in the history
  • Loading branch information
virgo47 committed Feb 27, 2023
1 parent cadee87 commit 811d45b
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1401,6 +1401,11 @@ default <O extends ObjectType> boolean hasArchetype(O object, String archetypeOi
@Deprecated
<O extends ObjectType> ArchetypeType getArchetype(O object) throws SchemaException;

/**
* Returns the structural archetype for the object, possibly `null`.
*/
@Nullable <O extends AssignmentHolderType> ArchetypeType getStructuralArchetype(O object) throws SchemaException;

@NotNull <O extends ObjectType> List<ArchetypeType> getArchetypes(O object) throws SchemaException;

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -589,7 +589,7 @@ public boolean hasActiveAssignmentTargetSubtype(String roleSubtype) {
if (target == null) {
continue;
}
//noinspection unchecked
//noinspection unchecked,rawtypes
Collection<String> targetSubtypes = FocusTypeUtil.determineSubTypes((PrismObject) target);
if (targetSubtypes.contains(roleSubtype)) {
return true;
Expand Down Expand Up @@ -815,7 +815,7 @@ private <O extends ObjectType, T> List<O> getObjectsInConflictOnPropertyValue(fi
}
};

//noinspection unchecked
//noinspection unchecked,rawtypes
modelObjectResolver.searchIterative((Class) objectType.getClass(), query, null, handler, task, result);

return conflictingObjects;
Expand Down Expand Up @@ -2069,7 +2069,7 @@ public <C extends Containerable> S_ItemEntry deltaFor(Class<C> objectClass) thro
// MID-5243

/**
* DEPRECATED use getArchetypes(object)
* DEPRECATED use getArchetypes(object) or getStructuralArchetype(object)
*/
@Override
@Deprecated
Expand All @@ -2078,6 +2078,12 @@ public <O extends ObjectType> ArchetypeType getArchetype(O object) throws Schema
archetypeManager.determineArchetypes(object, getCurrentResult()));
}

@Override
public @Nullable <O extends AssignmentHolderType> ArchetypeType getStructuralArchetype(O object)
throws SchemaException {
return archetypeManager.determineStructuralArchetype(object, getCurrentResult());
}

@NotNull
public <O extends ObjectType> List<ArchetypeType> getArchetypes(O object) throws SchemaException {
return archetypeManager.determineArchetypes(object, getCurrentResult());
Expand Down

0 comments on commit 811d45b

Please sign in to comment.