Class ConfigurationItem<T extends Serializable & Cloneable>
java.lang.Object
com.evolveum.midpoint.schema.config.ConfigurationItem<T>
- All Implemented Interfaces:
Serializable
,Cloneable
- Direct Known Subclasses:
AbstractAssignmentConfigItem
,AbstractAttributeMappingsDefinitionConfigItem
,AbstractPolicyRuleConfigItem
,AbstractResourceObjectDefinitionConfigItem
,AutoAssignMappingConfigItem
,AutoassignSpecificationConfigItem
,ConstructionConfigItem
,EventHandlerConfigItem
,ExecuteScriptConfigItem
,ExpressionConfigItem
,ExpressionParameterConfigItem
,FocalAutoassignSpecificationConfigItem
,FunctionExpressionEvaluatorConfigItem
,InboundMappingConfigItem
,MappingConfigItem
,MetadataMappingConfigItem
,MultiSourceDataHandlingConfigItem
,MultiSourceItemDefinitionConfigItem
,ObjectSelectorConfigItem
,ObjectTemplateItemDefinitionConfigItem
,ObjectTemplateMappingConfigItem
,PolicyActionConfigItem
,ReferencesCapabilityConfigItem
,ResourceAttributeDefinitionConfigItem
,ResourceObjectAssociationConfigItem
,SchemaHandlingConfigItem
,ShadowAssociationDefinitionConfigItem
,ShadowAssociationTypeDefinitionConfigItem
,ShadowAssociationTypeObjectDefinitionConfigItem
,ShadowAssociationTypeSubjectDefinitionConfigItem
,SimulatedReferenceTypeConfigItem
,SimulatedReferenceTypeParticipantConfigItem
,SimulatedReferenceTypeParticipantDelineationConfigItem
@Experimental
public class ConfigurationItem<T extends Serializable & Cloneable>
extends Object
implements Serializable, Cloneable
Helper class that provides complex information about a configuration item (e.g., a mapping).
Currently, the most prominent information is the origin of the item value.
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Object
Used as a convenience marker forfullDescription()
in error messages. -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
ConfigurationItem
(@NotNull ConfigurationItem<? extends T> original) For internal use.ConfigurationItem
(T value, @NotNull ConfigurationItemOrigin origin, @Nullable ConfigurationItem<?> parent) -
Method Summary
Modifier and TypeMethodDescription<X extends ConfigurationItem<T>>
Xprotected static <V extends Serializable & Cloneable,
CI extends RAW_CI, RAW_CI extends ConfigurationItem<V>>
CINull-safe variant ofas(Class)
.static <T extends Serializable & Cloneable,
X extends ConfigurationItem<T>>
@NotNull List<X>asList
(@NotNull List<ConfigurationItem<T>> list, @NotNull Class<X> clazz) default void
checkNamespace
(@NotNull QName name, String expectedNamespace) <X extends Serializable & Cloneable,
CI extends ConfigurationItem<X>>
CIprotected <X extends Serializable & Cloneable>
ConfigurationItem<X>clone()
Intentionally not calling super.clone, as the value is final (and we have to clone it); so we would have to hack this using reflection turning off the `final` flag.default void
configCheck
(boolean value, String template, Object... arguments) Checks the value, and if it's `false`, emits aConfigurationException
.default @NotNull ConfigurationException
configException
(String template, Object... arguments) default @NotNull ConfigurationException
configException
(Throwable cause, String template, Object... arguments) static <T extends Serializable & Cloneable,
X extends ConfigurationItem<T>>
XconfigItem
(T value, @NotNull ConfigurationItemOrigin origin, @NotNull Class<X> clazz) Simple way of constructing a typed configuration item.static <T extends Serializable & Cloneable,
X extends ConfigurationItem<T>>
XconfigItem
(T value, @NotNull ConfigurationItemOrigin origin, @Nullable ConfigurationItem<?> parent, @NotNull Class<X> clazz) Simple way of constructing a typed configuration item.static <T extends Serializable & Cloneable,
X extends ConfigurationItem<T>>
XconfigItemNullable
(T value, @NotNull ConfigurationItemOrigin origin, @NotNull Class<X> clazz) Simple way of constructing a typed configuration item.default <V> V
configNonNull
(V value, String template, Object... arguments) AsconfigCheck(boolean, String, Object...)
, but checks that the value is not null.static <T extends Serializable & Cloneable>
@NotNull ConfigurationItem<T>embedded
(T value) static <T extends Serializable & Cloneable>
ConfigurationItem<T>embeddedNullable
(T value) default @NotNull QName
enforceNamespace
(@NotNull QName name, @NotNull String requiredNamespace) Just likeQNameUtil.enforceNamespace(QName, String)
but throwingConfigurationException
.boolean
@NotNull String
@NotNull String
default @NotNull String
getLocalPart
(@NotNull QName name, String expectedNamespace) int
hashCode()
@NotNull String
To be overridden in specific subclasses.default <C extends Collection<?>>
Cdefault <C extends Collection<?>>
Cdefault <V> V
Even more shortened version.static <T extends Serializable & Cloneable>
@NotNull ConfigurationItem<T>of
(T value, @NotNull ConfigurationItemOrigin origin) Deprecated.static <T extends Serializable & Cloneable,
X extends ConfigurationItem<T>>
@NotNull List<X>ofList
(@NotNull List<T> items, @NotNull OriginProvider<? super T> originProvider, @NotNull Class<X> clazz) @NotNull ConfigurationItemOrigin
origin()
default @NotNull ConfigurationItemOrigin
default <C extends Containerable>
@NotNull OriginProvider<C>originProviderFor
(@NotNull ItemPath path) default <C> C
single
(Collection<? extends C> collection, String template, Object... arguments) default @NotNull ItemName
singleNameRequired
(ItemPathType name, Object itemDesc) toString()
value()
static <T extends Serializable & Cloneable>
Tvalue
(@Nullable ConfigurationItem<T> item)
-
Field Details
-
DESC
Used as a convenience marker forfullDescription()
in error messages.
-
-
Constructor Details
-
ConfigurationItem
For internal use. -
ConfigurationItem
public ConfigurationItem(@NotNull T value, @NotNull @NotNull ConfigurationItemOrigin origin, @Nullable @Nullable ConfigurationItem<?> parent)
-
-
Method Details
-
configItem
@NotNull public static <T extends Serializable & Cloneable,X extends ConfigurationItem<T>> X configItem(@NotNull T value, @NotNull @NotNull ConfigurationItemOrigin origin, @NotNull @NotNull Class<X> clazz) Simple way of constructing a typed configuration item. To be imported statically. -
configItem
@NotNull public static <T extends Serializable & Cloneable,X extends ConfigurationItem<T>> X configItem(@NotNull T value, @NotNull @NotNull ConfigurationItemOrigin origin, @Nullable @Nullable ConfigurationItem<?> parent, @NotNull @NotNull Class<X> clazz) Simple way of constructing a typed configuration item. To be imported statically. -
configItemNullable
@Contract("!null, _, _ -> !null; null, _, _ -> null") public static <T extends Serializable & Cloneable,X extends ConfigurationItem<T>> X configItemNullable(@Nullable T value, @NotNull @NotNull ConfigurationItemOrigin origin, @NotNull @NotNull Class<X> clazz) Simple way of constructing a typed configuration item. To be imported statically. -
of
@Deprecated @NotNull public static <T extends Serializable & Cloneable> @NotNull ConfigurationItem<T> of(@NotNull T value, @NotNull @NotNull ConfigurationItemOrigin origin) Deprecated. -
embedded
@NotNull public static <T extends Serializable & Cloneable> @NotNull ConfigurationItem<T> embedded(@NotNull T value) -
embeddedNullable
@Contract("!null -> !null; null -> null") public static <T extends Serializable & Cloneable> ConfigurationItem<T> embeddedNullable(T value) -
ofList
@NotNull public static <T extends Serializable & Cloneable,X extends ConfigurationItem<T>> @NotNull List<X> ofList(@NotNull @NotNull List<T> items, @NotNull @NotNull OriginProvider<? super T> originProvider, @NotNull @NotNull Class<X> clazz) -
value
-
value
public static <T extends Serializable & Cloneable> T value(@Nullable @Nullable ConfigurationItem<T> item) -
origin
-
as
@Contract("null, _ -> null; !null, _ -> !null") protected static <V extends Serializable & Cloneable,CI extends RAW_CI, CI asRAW_CI extends ConfigurationItem<V>> (@Nullable RAW_CI value, @NotNull @NotNull Class<CI> clazz) Null-safe variant ofas(Class)
. -
asList
@NotNull public static <T extends Serializable & Cloneable,X extends ConfigurationItem<T>> @NotNull List<X> asList(@NotNull @NotNull List<ConfigurationItem<T>> list, @NotNull @NotNull Class<X> clazz) -
as
-
child
@Contract("null, _, _ -> null; !null, _, _ -> !null") public <X extends Serializable & Cloneable,CI extends ConfigurationItem<X>> CI child(@Nullable X value, @NotNull @NotNull Class<CI> clazz, Object... pathSegments) -
child
@Contract("null, _ -> null; !null, _ -> !null") protected <X extends Serializable & Cloneable> ConfigurationItem<X> child(@Nullable X value, Object... pathSegments) -
equals
-
hashCode
public int hashCode() -
clone
Intentionally not calling super.clone, as the value is final (and we have to clone it); so we would have to hack this using reflection turning off the `final` flag. -
toString
-
localDescription
To be overridden in specific subclasses. -
fullDescription
-
fullOriginLessDescription
-
configCheck
@Contract("false, _, _ -> fail") default void configCheck(boolean value, String template, Object... arguments) throws ConfigurationException Checks the value, and if it's `false`, emits aConfigurationException
. Note thatDESC
can be used as a placeholder forfullDescription()
in the `arguments`.- Throws:
ConfigurationException
-
checkNamespace
default void checkNamespace(@NotNull @NotNull QName name, String expectedNamespace) throws ConfigurationException - Throws:
ConfigurationException
-
enforceNamespace
@NotNull default @NotNull QName enforceNamespace(@NotNull @NotNull QName name, @NotNull @NotNull String requiredNamespace) throws ConfigurationException Just likeQNameUtil.enforceNamespace(QName, String)
but throwingConfigurationException
.- Throws:
ConfigurationException
-
getLocalPart
@NotNull default @NotNull String getLocalPart(@NotNull @NotNull QName name, String expectedNamespace) throws ConfigurationException - Throws:
ConfigurationException
-
configException
@NotNull default @NotNull ConfigurationException configException(Throwable cause, String template, Object... arguments) -
configException
@NotNull default @NotNull ConfigurationException configException(String template, Object... arguments) -
configNonNull
@Contract("null, _, _ -> fail") @NotNull default <V> V configNonNull(V value, String template, Object... arguments) throws ConfigurationException AsconfigCheck(boolean, String, Object...)
, but checks that the value is not null.- Throws:
ConfigurationException
-
nonNull
@Contract("null, _ -> fail") @NotNull default <V> V nonNull(V value, Object itemDesc) throws ConfigurationException Even more shortened version.- Throws:
ConfigurationException
-
nonEmpty
@NotNull default <C extends Collection<?>> C nonEmpty(C collection, Object itemDescription) throws ConfigurationException - Throws:
ConfigurationException
-
nonEmpty
@NotNull default <C extends Collection<?>> C nonEmpty(C collection, String template, Object... arguments) throws ConfigurationException - Throws:
ConfigurationException
-
singleNameRequired
@NotNull default @NotNull ItemName singleNameRequired(ItemPathType name, Object itemDesc) throws ConfigurationException - Throws:
ConfigurationException
-
single
@Nullable default <C> C single(Collection<? extends C> collection, String template, Object... arguments) throws ConfigurationException - Throws:
ConfigurationException
-
originProviderFor
@NotNull default <C extends Containerable> @NotNull OriginProvider<C> originProviderFor(@NotNull @NotNull ItemPath path) -
originFor
-