Interface References<R>

Type Parameters:
R - the contextual reference type
All Superinterfaces:
Iterable<R>, ReferencesSelector

public interface References<R> extends Iterable<R>, ReferencesSelector
Author:
Laird Nelson
See Also:
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    Destroys the supplied contextual reference if and only if it meets the conditions for destruction.
    default R
    get()
    A convenience method that acquires and returns what is presumed, possibly incorrectly, to be the sole contextual reference available from this References.

    Methods inherited from interface java.lang.Iterable

    forEach, iterator, spliterator

    Methods inherited from interface org.microbean.bean.ReferencesSelector

    references
  • Method Details

    • get

      default R get()
      A convenience method that acquires and returns what is presumed, possibly incorrectly, to be the sole contextual reference available from this References.
      Returns:
      a contextual reference; never null
      Throws:
      UnsatisfiedReductionException - if there are no contextual references
      AmbiguousReductionException - if there is more than one contextual reference
    • destroy

      boolean destroy(R r)
      Destroys the supplied contextual reference if and only if it meets the conditions for destruction.
      Parameters:
      r - a contextual reference; may be null in which case false will be returned
      Returns:
      true if and only if destruction occurred
      Throws:
      DestructionException - if an error occurs