Class ListReferencePropertyBuilder<C>
java.lang.Object
com.inductiveautomation.ignition.gateway.config.ListReferencePropertyBuilder<C>
- Type Parameters:
C- The type of the configuration object. This may be the config type "R" that matches aResourceTypeMeta, or it may be the profile type "P" (profile) of an extension point or the type "S" (settings) of anExtensionPoint, depending on the context of where this reference property is used.
Helps build a
ReferenceProperty for a property whose value is an ordered list of
resource names (as opposed to ReferencePropertyBuilder, which handles a single scalar
reference).
When the referenced resource is renamed, only the matching element(s) of the list are
rewritten; the order and the other elements are preserved. The old name being renamed is captured
at reference-discovery time, since the framework's ReferenceUpdater.update(Object, String) callback is only handed the new name.
-
Constructor Summary
ConstructorsConstructorDescriptionListReferencePropertyBuilder(@NonNull ResourceType sourceType, @NonNull String propertyName) -
Method Summary
Modifier and TypeMethodDescriptioncaseSensitive(boolean caseSensitiveMatch) Sets case sensitivity for the reference match.targetType(ResourceType targetResourceType) values(Function<C, ? extends Collection<String>> getValuesFn)
-
Constructor Details
-
ListReferencePropertyBuilder
-
-
Method Details
-
targetType
- Parameters:
targetResourceType- The resource type of the target resource that this reference finder is looking for.
-
values
public ListReferencePropertyBuilder<C> values(Function<C, ? extends Collection<String>> getValuesFn) - Parameters:
getValuesFn- A function that extracts the list of reference values - the names of the resources that this reference property references on the given resource config object. May return null or an empty collection, both of which are treated as "no references".
-
onUpdate
- Parameters:
updateConfig- A callback that returns a new copy of the configuration object with the reference list replaced by the given (already-updated) list. The list passed to the callback preserves the original ordering, with any matching elements rewritten to the new name.
-
caseSensitive
Sets case sensitivity for the reference match. If not called, will default to case-insensitive match.
-