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 a ResourceTypeMeta, or it may be the profile type "P" (profile) of an extension point or the type "S" (settings) of an ExtensionPoint, depending on the context of where this reference property is used.

public class ListReferencePropertyBuilder<C> extends Object
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 Details

    • ListReferencePropertyBuilder

      public ListReferencePropertyBuilder(@NonNull ResourceType sourceType, @NonNull String propertyName)
  • Method Details

    • targetType

      public ListReferencePropertyBuilder<C> targetType(ResourceType targetResourceType)
      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

      public ListReferencePropertyBuilder<C> onUpdate(BiFunction<C, List<String>, C> updateConfig)
      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

      public ListReferencePropertyBuilder<C> caseSensitive(boolean caseSensitiveMatch)
      Sets case sensitivity for the reference match. If not called, will default to case-insensitive match.