binary.checked.ByteBoolToCharE Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of functions-binary-extended Show documentation
Show all versions of functions-binary-extended Show documentation
Provides functional interfaces for most two-argument functions
package net.mintern.functions.binary.checked;
/**
* An operation of type {@code (byte, boolean) -> char}.
*
* @param the {@code Exception} type that the operation may throw
*/
@FunctionalInterface
public interface ByteBoolToCharE {
/**
* Performs this operation.
*
* @param b argument 1
* @param bool argument 2
* @return the result of the operation
* @throws E if the operation cannot be completed
*/
char call(byte b, boolean bool) throws E;
/**
* Binds {@code (b)} to the beginning of {@code f}, returning a new function
* of type {@code (boolean) -> char}.
*
* @param the {@code Exception} type that the operation may throw
* @param f the unbound function
* @param b argument 1
* @return a new function {@code (boolean bool) -> char} that calls
* {@code f.call(b, bool)} and returns the result.
*/
static net.mintern.functions.unary.checked.BoolToCharE
bind(ByteBoolToCharE f, byte b) {
return (bool) -> f.call(b, bool);
}
/**
* Binds {@code (b)} to the beginning of {@code this}, returning a new function
* of type {@code (boolean) -> char}.
*
* @param b argument 1
* @return a new function {@code (boolean bool) -> char} that calls
* {@code this.call(b, bool)} and returns the result.
*/
default net.mintern.functions.unary.checked.BoolToCharE bind(byte b) {
return ByteBoolToCharE.bind(this, b);
}
/**
* Binds {@code (bool)} to the end of {@code f}, returning a new function
* of type {@code (byte) -> char}.
*
* @param the {@code Exception} type that the operation may throw
* @param f the unbound function
* @param bool argument 2
* @return a new function {@code (byte b) -> char} that calls
* {@code f.call(b, bool)} and returns the result.
*/
static net.mintern.functions.unary.checked.ByteToCharE
rbind(ByteBoolToCharE f, boolean bool) {
return (b) -> f.call(b, bool);
}
/**
* Binds {@code (bool)} to the end of {@code this}, returning a new function
* of type {@code (byte) -> char}.
*
* @param bool argument 2
* @return a new function {@code (byte b) -> char} that calls
* {@code this.call(b, bool)} and returns the result.
*/
default net.mintern.functions.unary.checked.ByteToCharE rbind(boolean bool) {
return ByteBoolToCharE.rbind(this, bool);
}
/**
* Binds {@code (b, bool)} to {@code f}, returning a new function
* of type {@code () -> char}.
*
* @param the {@code Exception} type that the operation may throw
* @param f the unbound function
* @param b argument 1
* @param bool argument 2
* @return a new function {@code () -> char} that calls
* {@code f.call(b, bool)} and returns the result.
*/
static net.mintern.functions.nullary.checked.NilToCharE
bind(ByteBoolToCharE f, byte b, boolean bool) {
return () -> f.call(b, bool);
}
/**
* Binds {@code (b, bool)} to {@code this}, returning a new function
* of type {@code () -> char}.
*
* @param b argument 1
* @param bool argument 2
* @return a new function {@code () -> char} that calls
* {@code this.call(b, bool)} and returns the result.
*/
default net.mintern.functions.nullary.checked.NilToCharE bind(byte b, boolean bool) {
return ByteBoolToCharE.bind(this, b, bool);
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy