Class ChainableAssignment<V,C>

java.lang.Object
no.digipost.util.ChainableAssignment<V,C>
Type Parameters:
C - The "chain" type, which is returned from each call to is(Object) to allow chained invocation.
All Implemented Interfaces:
Consumer<V>, Supplier<V>, Assignment<V>, ViewableAsOptional<V>, ViewableAsOptional.Single<V>

public final class ChainableAssignment<V,C> extends Object implements Assignment<V>
An Assignment with the added ability to chain several assignments with is(Object).
  • Constructor Details

    • ChainableAssignment

      public ChainableAssignment(Assignment<V> assignment, C chainReturnObject)
  • Method Details

    • is

      public C is(V value)
      Assign the given value and return object to allow chained invocation.
      Parameters:
      value - the value to assign
      Returns:
      the object to allow further chained invocation
    • get

      public V get()
      Specified by:
      get in interface Supplier<V>
    • set

      public void set(V value)
      Description copied from interface: Assignment
      Assign the given value.
      Specified by:
      set in interface Assignment<V>
      Parameters:
      value - the value to assign.