monniasza.collects.selfset.HashSelfSet Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of multimachinebuilder Show documentation
Show all versions of multimachinebuilder Show documentation
Dependency for the MultiMachineBuilder, a voxel game about building an industrial empire in a finite world.
THIS RELEASE IS NOT PLAYABLE. To play the game, donwload from >ITCH.IO LINK HERE< or >GH releases link here<
/**
*
*/
package monniasza.collects.selfset;
import java.util.HashMap;
import java.util.function.Function;
import mmb.NN;
import mmb.Nil;
import monniasza.collects.Identifiable;
/**
* @author oskar
*/
public class HashSelfSet{
private HashSelfSet() {}
@NN public static > SelfSet<@Nil K, V> createNullable(Class valclass){
return createNullable(valclass, Identifiable::id);
}
@NN public static SelfSet<@Nil K, V> createNullable(Class valclass, Function id){
return new BaseMapSelfSet<>(new HashMap<>(), true, valclass, id);
}
@NN public static > SelfSet<@NN K, V> createNonnull(Class valclass){
return createNonnull(valclass, Identifiable::id);
}
@NN public static SelfSet<@NN K, V> createNonnull(Class valclass, Function id){
return new BaseMapSelfSet<>(new HashMap<>(), false, valclass, id);
}
}