本文整理了Java中de.pfabulist.unchecked.Unchecked
类的一些代码示例,展示了Unchecked
类的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Unchecked
类的具体详情如下:
包路径:de.pfabulist.unchecked.Unchecked
类名称:Unchecked
[英]Copyright (c) 2006 - 2016, Stephan Pfab SPDX-License-Identifier: BSD-2-Clause
[中]版权所有(c)2006-2016,Stephan Pfab SPDX许可证标识符:BSD-2-2条款
代码示例来源:origin: de.pfabulist.lindwurm/stellvertreter
public Cipher getEncryptingCipher() {
Cipher ecipher = u( () -> Cipher.getInstance( blockCipher.getBlockCipherDescription() ) );
u( () -> ecipher.init( Cipher.ENCRYPT_MODE, keyspec ) );
return ecipher;
}
代码示例来源:origin: de.pfabulist.kleinod/unchecked
public static RuntimeException u( Throwable t ) {
// http://www.mail-archive.com/javaposse@googlegroups.com/msg05984.html
// if( t == null ) {
// throw new NullPointerException();
// }
Unchecked.<RuntimeException>sneakyThrow0( t );
return null;
}
代码示例来源:origin: de.pfabulist/elsewhere
public void write( Path p ) {
try {
Files.write( p, root.toUri().toString().getBytes("UTF-8"));
} catch (IOException e) {
throw u( e );
}
}
代码示例来源:origin: de.pfabulist.lindwurm/stellvertreter
public Cipher getDecryptingCipher( byte[] iv ) {
Cipher decipher = u( () -> Cipher.getInstance( blockCipher.getBlockCipherDescription() ) );
u( () -> decipher.init( Cipher.DECRYPT_MODE, keyspec, new IvParameterSpec( iv ) ) );
return decipher;
}
代码示例来源:origin: de.pfabulist.lindwurm/stellvertreter
public Cipher getEncryptingCipher( byte[] iv ) {
Cipher ecipher = u( () -> Cipher.getInstance( blockCipher.getBlockCipherDescription() ) );
u( () -> ecipher.init( Cipher.ENCRYPT_MODE, keyspec, new IvParameterSpec( iv ) ) );
return ecipher;
}
代码示例来源:origin: de.pfabulist.lindwurm/memoryfs
public PathContent getOrThrow( EightyPath path, Supplier<Exception> exSup ) {
PathContent pc = content.get( path.getNormString() );
if( pc == null ) {
throw u( exSup.get() );
}
return pc;
}
}
代码示例来源:origin: de.pfabulist.kleinod/unchecked
@Override
default void accept( double a ) {
try {
acceptE( a );
} catch( Exception e ) {
throw Unchecked.u( e );
}
}
代码示例来源:origin: de.pfabulist.kleinod/unchecked
@Override
default void run(){
try {
runE();
} catch( Exception e ) {
throw Unchecked.u( e );
}
}
代码示例来源:origin: de.pfabulist.kleinod/unchecked
@Override
default long applyAsLong( int value ) {
try {
return applyAsLongE( value );
} catch( Exception e ) {
throw Unchecked.u( e );
}
}
代码示例来源:origin: de.pfabulist.kleinod/unchecked
@Override
default double applyAsDouble( double a, double a2 ) {
try {
return applyAsDoubleE( a, a2 );
} catch( Exception e ) {
throw Unchecked.u( e );
}
}
代码示例来源:origin: de.pfabulist.kleinod/unchecked
default D apply( A a, B b, C c ) {
try {
return applyE( a, b, c );
} catch( Exception e ) {
throw Unchecked.u( e );
}
}
代码示例来源:origin: de.pfabulist.kleinod/unchecked
@Override
default double applyAsDouble( int value ) {
try {
return applyAsDoubleE( value );
} catch( Exception e ) {
throw Unchecked.u( e );
}
}
代码示例来源:origin: de.pfabulist.kleinod/unchecked
@Override
default A apply( long value ) {
try {
return applyE( value );
} catch( Exception e ) {
throw Unchecked.u( e );
}
}
代码示例来源:origin: de.pfabulist.kleinod/unchecked
@Override
default boolean test( long value ) {
try {
return testE( value );
} catch( Exception e ) {
throw Unchecked.u( e );
}
}
代码示例来源:origin: de.pfabulist.kleinod/unchecked
@Override
default double applyAsDouble( double value ) {
try {
return applyAsDoubleE( value );
} catch( Exception e ) {
throw Unchecked.u( e );
}
}
代码示例来源:origin: de.pfabulist.kleinod/unchecked
default R _apply( A a, B b ) {
try {
return applyE( a, b );
} catch( Exception e ) {
throw Unchecked.u( e );
}
}
代码示例来源:origin: de.pfabulist.kleinod/unchecked
@Override
default void accept( int a ) {
try {
acceptE( a );
} catch( Exception e ) {
throw Unchecked.u( e );
}
}
代码示例来源:origin: de.pfabulist.kleinod/unchecked
@Override
default int applyAsInt( int value ) {
try {
return applyAsIntE( value );
} catch( Exception e ) {
throw Unchecked.u( e );
}
}
代码示例来源:origin: de.pfabulist.kleinod/unchecked
@Override
default boolean test( int value ) {
try {
return testE( value );
} catch( Exception e ) {
throw Unchecked.u( e );
}
}
代码示例来源:origin: de.pfabulist.kleinod/unchecked
default R apply( A a ) {
try {
return applyE( a );
} catch( Exception e ) {
throw Unchecked.u( e );
}
}
内容来源于网络,如有侵权,请联系作者删除!