-
Notifications
You must be signed in to change notification settings - Fork 188
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Unify types for attributes and associations
To avoid massive code duplication, (experimental) ShadowItemXXX types were introduced: ShadowItem, ShadowItemDefinition, ShadowItemsContainer. Hopefully they will be useful. Currently, it seems they cannot naturally inherit from (e.g.) Item, because there is a lot of conflicts on specific methods.
- Loading branch information
Showing
15 changed files
with
204 additions
and
112 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
33 changes: 33 additions & 0 deletions
33
infra/schema/src/main/java/com/evolveum/midpoint/schema/processor/ShadowItem.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
/* | ||
* Copyright (C) 2010-2024 Evolveum and contributors | ||
* | ||
* This work is dual-licensed under the Apache License 2.0 | ||
* and European Union Public License. See LICENSE file for details. | ||
*/ | ||
|
||
package com.evolveum.midpoint.schema.processor; | ||
|
||
import com.evolveum.midpoint.prism.Item; | ||
import com.evolveum.midpoint.prism.PrismValue; | ||
import com.evolveum.midpoint.util.annotation.Experimental; | ||
import com.evolveum.midpoint.util.exception.SchemaException; | ||
|
||
/** | ||
* Access to both {@link ResourceAttribute} and {@link ShadowAssociation}. | ||
* | ||
* Currently, it cannot extend {@link Item} because of the clash on many methods, like {@link Item#getValue()}. | ||
* (To be researched further.) | ||
*/ | ||
@Experimental | ||
public interface ShadowItem<PV, RV> { | ||
|
||
ShadowItem<PV, RV> clone(); | ||
|
||
void setIncomplete(boolean incomplete); | ||
|
||
boolean isIncomplete(); | ||
|
||
boolean hasNoValues(); | ||
|
||
void addValueSkipUniquenessCheck(PV value) throws SchemaException; | ||
} |
23 changes: 23 additions & 0 deletions
23
infra/schema/src/main/java/com/evolveum/midpoint/schema/processor/ShadowItemDefinition.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
/* | ||
* Copyright (C) 2010-2024 Evolveum and contributors | ||
* | ||
* This work is dual-licensed under the Apache License 2.0 | ||
* and European Union Public License. See LICENSE file for details. | ||
*/ | ||
|
||
package com.evolveum.midpoint.schema.processor; | ||
|
||
import org.jetbrains.annotations.NotNull; | ||
|
||
import com.evolveum.midpoint.prism.ItemDefinition; | ||
import com.evolveum.midpoint.util.exception.SchemaException; | ||
|
||
/** | ||
* Access to both {@link ResourceAttributeDefinition} and {@link ShadowAssociationDefinition}. | ||
* For the time being, it does not extend {@link ItemDefinition} because of typing complications. | ||
*/ | ||
public interface ShadowItemDefinition<I extends ShadowItem> { | ||
|
||
@NotNull I instantiate() throws SchemaException; | ||
|
||
} |
14 changes: 14 additions & 0 deletions
14
infra/schema/src/main/java/com/evolveum/midpoint/schema/processor/ShadowItemsContainer.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
/* | ||
* Copyright (C) 2010-2024 Evolveum and contributors | ||
* | ||
* This work is dual-licensed under the Apache License 2.0 | ||
* and European Union Public License. See LICENSE file for details. | ||
*/ | ||
|
||
package com.evolveum.midpoint.schema.processor; | ||
|
||
/** Supertype for {@link ResourceAttributeContainer} and {@link ShadowAssociationsContainer}. */ | ||
public interface ShadowItemsContainer { | ||
|
||
ShadowItemsContainer clone(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.