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

com.github.atdixon.vroom.TS Maven / Gradle / Ivy

Go to download

Work immutably, robustly and in a knowledge-oriented way with Entity maps in Java.

The newest version!
package com.github.atdixon.vroom;

import java.util.List;
import java.util.Map;
import java.util.Optional;
import java.util.Set;

/** Type factories. */
public final class TS {
    private TS() {}

    public static  TypeSupplier> Optional(Class type) {
        return () -> new ParameterizedTypeImpl(null, Optional.class, type);
    }

    public static  TypeSupplier> List(Class type) {
        return () -> new ParameterizedTypeImpl(null, List.class, type);
    }

    public static  TypeSupplier> Set(Class type) {
        return () -> new ParameterizedTypeImpl(null, Set.class, type);
    }

    public static TypeSupplier> Map() {
        return () -> new ParameterizedTypeImpl(null, Map.class, String.class, Object.class);
    }

    public static  TypeSupplier> List(TypeSupplier type) {
        return () -> new ParameterizedTypeImpl(null, List.class, type.get());
    }

    public static  TypeSupplier> Set(TypeSupplier type) {
        return () -> new ParameterizedTypeImpl(null, Set.class, type.get());
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy