Interface Try.Assignment<V>

  • Type Parameters:
    V - value type
    Enclosing class:
    Try
    Functional Interface:
    This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

    @FunctionalInterface
    public static interface Try.Assignment<V>
    Functional interface for calls to Try.assign(...). For this a lambda expression can be used.
     FileInputStream fis = Try.assign(() -> new FileInputStream(fileString), IllegalArgumentException.class,
             "File %s is not a valid file.", fileString);
     

    Copyright (c) 2013-2023 Delft University of Technology, PO Box 5, 2600 AA, Delft, the Netherlands. All rights reserved.
    BSD-style license. See DJUTILS License.

    Version:
    $Revision$, $LastChangedDate$, by $Author$, initial version 31 jan. 2018
    Author:
    Alexander Verbraeck, Peter Knoppers
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      V assign()
      Returns a value which is obtained from the context in which the Assignment was created.
    • Method Detail

      • assign

        V assign()
          throws Throwable
        Returns a value which is obtained from the context in which the Assignment was created.
        Returns:
        value which is obtained from the context in which the Assignment was created
        Throws:
        Throwable - on any throwable in the try