Class SequenceBinding

java.lang.Object
honeyroasted.fill.bindings.SequenceBinding
All Implemented Interfaces:
Binding

public class SequenceBinding extends Object implements Binding
An implementation of Binding which contains a list of other bindings and applies the first one which claims a given target
  • Constructor Details

    • SequenceBinding

      public SequenceBinding(List<Binding> bindings)
      Creates a new SequenceBinding
      Parameters:
      bindings - The bindings
  • Method Details

    • of

      public static SequenceBinding of(Binding... bindings)
      Creates a new SequenceBinding with the given bindings
      Parameters:
      bindings - The bindings
      Returns:
      A new SequenceBinding
    • bindings

      public List<Binding> bindings()
      Returns the children Bindings for this Sequence binding.
      Returns:
      The children Bindings
    • claims

      public boolean claims(honeyroasted.jype.system.JTypeSystem system, InjectionTarget target)
      Description copied from interface: Binding
      Test whether this Binding handles the given InjectionTarget
      Specified by:
      claims in interface Binding
      Parameters:
      system - The JTypeSystem to use for type logic
      target - The injection target
      Returns:
      True if this binding handles the given target
    • handle

      public InjectionResult handle(honeyroasted.jype.system.JTypeSystem system, InjectionTarget target)
      Description copied from interface: Binding
      Handles the given InjectionTarget
      Specified by:
      handle in interface Binding
      Parameters:
      system - The JTypeSystem to use for type logic
      target - The injection target
      Returns:
      The InjectionResult of handling the given target