Codota Logo
SupplierE
Code IndexAdd Codota to your IDE (free)

How to use
SupplierE
in
de.pfabulist.unchecked.functiontypes

Best Java code snippets using de.pfabulist.unchecked.functiontypes.SupplierE (Showing top 11 results out of 315)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
ArrayList a =
  • Codota Iconnew ArrayList<String>()
  • Codota Iconnew ArrayList()
  • Codota Iconnew ArrayList<Object>()
  • Smart code suggestions by Codota
}
origin: de.pfabulist.lindwurm/niotest

public <T, E extends Exception> T getOrElse( Class<T> klass, String key, SupplierE<T, E> els ) {
  Object val = props.get( key );
  if( val == null ) {
    return els.get();
  }
  if( !klass.isAssignableFrom( val.getClass() ) ) {
    throw new IllegalStateException( "niotest error: wrong class for: " + key + " expected: " + klass + " got: " + val.getClass() );
  }
  return klass.cast( val );
}
origin: de.pfabulist.kleinod/unchecked

public static
<T,X extends Exception> T _orElseGet( @Nullable T t, SupplierE<T,X> supp) {
  if( t == null ) {
    return supp._get();
  }
  return t;
}
origin: de.pfabulist.lindwurm/eightyfs

public Object read( FileAttributeView view, String attiName ) {
  checkViewType( view );
  return reads.getOrThrow( attiName,
               new IllegalArgumentException( "attribute " + attiName + " not in view " + getViewName() ) )
      .apply( v( () -> readType.cast( viewType.cast( view ).readAttributes() ) ) );
}
origin: de.pfabulist.kleinod/unchecked

default R _get() {
  try {
    return getE();
  } catch( Exception e ) {
    throw Unchecked.u( e );
  }
}
origin: de.pfabulist.lindwurm/eightyfs

/**
 * if the the FAV is actually a BasicFileAttributeView then there is an isLink method
 * if this is not already set and FAV implements LinkInfoSettable use it to add this link info
 */
@SuppressWarnings( "PMD.CollapsibleIfStatements" )
private <V extends FileAttributeView> V addIsLinkIfPossible( Class<V> type, V fav ) {
  if( BasicFileAttributeView.class.isAssignableFrom( type ) ) {
    if( (! v( () -> BasicFileAttributeView.class.cast( fav ).readAttributes()).isSymbolicLink() )) {
      if( !( fav instanceof LinkInfoSettable ) ) {
        throw new UnsupportedOperationException( "the attribute view need to implement LinkInfoSettable in order to make SymLinks work" );
      }
      ( (LinkInfoSettable) ( fav ) ).setLink();
    }
  }
  return fav;
}
origin: de.pfabulist.kleinod/unchecked

static <T, E extends Exception> T v( SupplierE<T, E> f ) {
  return _nn( f.get() );
}
origin: de.pfabulist.kleinod/unchecked

@Override
default
@Nullable
R get() {
  return _get();
}
origin: de.pfabulist.lindwurm/eightyfs

@Override
public <A extends BasicFileAttributes> A getReadAttributes( Class<A> read, FileAttributeView fav ) {
  checkViewType( fav );
  checkReadType( read );
  return read.cast( v( () -> viewType.cast( fav ).readAttributes() ) );
}
origin: de.pfabulist.kleinod/unchecked

public static <T, E extends Exception> T u( SupplierE<T, E> f ) {
  return _nn(f.get());
}
origin: de.pfabulist.kleinod/unchecked

public static <T, X extends Throwable, E extends Exception> T _orElseExpectedThrow( @Nullable T t, SupplierE<X, E> exceptionSupplier ) {
  if( t == null ) {
    throw Unchecked.u( exceptionSupplier._get() );
  }
  return t;
}
origin: de.pfabulist.kleinod/unchecked

public static <T, X extends Throwable, E extends Exception> T _orElseThrow( @Nullable T t, SupplierE<X, E> exceptionSupplier ) {
  if( t == null ) {
    logger.warn( "value is null " + getProblemMethod() );
    throw Unchecked.u( exceptionSupplier._get() );
  }
  return t;
}
de.pfabulist.unchecked.functiontypesSupplierE

Javadoc

** BEGIN LICENSE BLOCK BSD License (2 clause) Copyright (c) 2006 - 2016, Stephan Pfab All rights reserved.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL Stephan Pfab BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. **** END LICENSE BLOCK

Most used methods

  • get
  • _get
  • getE
  • v

Popular in Java

  • Creating JSON documents from java classes using gson
  • runOnUiThread (Activity)
  • requestLocationUpdates (LocationManager)
  • getOriginalFilename (MultipartFile)
    Return the original filename in the client's filesystem.This may contain path information depending
  • FileOutputStream (java.io)
    A file output stream is an output stream for writing data to aFile or to a FileDescriptor. Whether
  • NumberFormat (java.text)
    The abstract base class for all number formats. This class provides the interface for formatting and
  • HashMap (java.util)
    HashMap is an implementation of Map. All optional operations are supported.All elements are permitte
  • Set (java.util)
    A collection that contains no duplicate elements. More formally, sets contain no pair of elements e1
  • Executors (java.util.concurrent)
    Factory and utility methods for Executor, ExecutorService, ScheduledExecutorService, ThreadFactory,
  • Scheduler (org.quartz)
    This is the main interface of a Quartz Scheduler. A Scheduler maintains a registery of org.quartz
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now