All Downloads are FREE. Search and download functionalities are using the official Maven repository.

angry1980.utils.Numbered Maven / Gradle / Ivy

There is a newer version: 0.0.10
Show newest version
package angry1980.utils;

import java.util.function.Function;

public class Numbered {

    public static  Function, Numbered> transformator(Function f){
        return (numbered) -> new Numbered(numbered.getNumber(), f.apply(numbered.getValue()));
    }

    private final long number;
    private final T value;

    public Numbered(long number, T value) {
        this.number = number;
        this.value = value;
    }

    public long getNumber() {
        return number;
    }

    public int getNumberAsInt(){
        return (int)number;
    }

    public T getValue() {
        return value;
    }

    @Override
    public String toString() {
        return "Numbered{" +
                "number=" + number +
                ", value=" + value +
                '}';
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy