com.mmnaseri.utils.tuples.FixedTuple Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of tuples4j Show documentation
Show all versions of tuples4j Show documentation
Tiny framework for using tuples as first-class citizens in Java.
package com.mmnaseri.utils.tuples;
import com.mmnaseri.utils.tuples.impl.EmptyTuple;
import java.util.function.Function;
/**
* Base interface for a tuple that has a size within the range of 1-12.
*
* @author Milad Naseri ([email protected])
*/
public interface FixedTuple> extends Tuple {
/** Returns an {@link EmptyTuple}. */
@Override
default EmptyTuple clear() {
return EmptyTuple.of();
}
/**
* Extends the current tuple by applying the provided function to it and appending the resulting
* value to the end of this tuple.
*/
Tuple extend(Function function);
/**
* Returns a new tuple that changes the value of the element at the given index by applying the
* provided function to the current tuple.
*/
Tuple change(int index, Function function);
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy