001package arez.spy;
002
003import arez.ComputableValue;
004import java.util.List;
005import javax.annotation.Nonnull;
006
007/**
008 * A representation of a component instance exposed to spy framework.
009 */
010public interface ComponentInfo
011  extends ElementInfo
012{
013  /**
014   * Return the component type.
015   * This is an opaque string specified by the user.
016   *
017   * @return the component type.
018   */
019  @Nonnull
020  String getType();
021
022  /**
023   * Return the unique id of the component.
024   * This will return null for singletons.
025   *
026   * @return the unique id of the component.
027   */
028  @Nonnull
029  Object getId();
030
031  /**
032   * Return the Observables associated with the component.
033   * This does NOT include observables that are associated with a {@link ComputableValue}.
034   * This collection returned is unmodifiable.
035   *
036   * @return the associated observables.
037   */
038  List<ObservableValueInfo> getObservableValues();
039
040  /**
041   * Return the Observers associated with the component.
042   * This does NOT include observers that are associated with a {@link ComputableValue}.
043   * This collection returned is unmodifiable. This operation recreates the list and is
044   * a relatively expensive operation.
045   *
046   * @return the associated observers.
047   */
048  List<ObserverInfo> getObservers();
049
050  /**
051   * Return the ComputableValues associated with the component.
052   * This collection returned is unmodifiable.
053   *
054   * @return the associated computable values.
055   */
056  List<ComputableValueInfo> getComputableValues();
057}