Interface ReferenceProperty<C>

Type Parameters:
C - The type of the configuration object for the resource, once decoded

public interface ReferenceProperty<C>
A property on a resource that references another resource. The reference property will be a string property, referencing the name of another resource.

Usually built using a ReferencePropertyBuilder

  • Method Details

    • getSourceType

      ResourceType getSourceType()
      Returns:
      The type of the resource that this property is on
    • getTargetType

      ResourceType getTargetType()
      Returns:
      The type of the resource that this property references
    • getReferenceValues

      Collection<ReferencePropertyValue> getReferenceValues(C config)
      Parameters:
      config - A decoded resource configuration object
      Returns:
      The reference values of this property in the given object
    • findReference

      Optional<ReferenceUpdater<C>> findReference(C config, ResourcePath targetResource)
      Find references to the target resource in the given object
      Parameters:
      config - The config object to check and see if it references the target
      targetResource - The target to see if any properties of config reference
      Returns:
      A reference updater, if any reference was found. This object knows the name of the property that holds the reference, and the logic to create a new copy of the config object with the reference updated.