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

ca.pjer.spring.boot.jdbi.MultiBean Maven / Gradle / Ivy

The newest version!
package ca.pjer.spring.boot.jdbi;

import java.io.Serializable;
import java.util.HashMap;
import java.util.Map;
import java.util.Set;

public class MultiBean implements Cloneable, Serializable {
    private final Map beans = new HashMap<>();

    void put(Class type, Object bean) {
        beans.put(type, bean);
    }

    public Set typeSet() {
        return beans.keySet();
    }

    public  T get(Class type) {
        return type.cast(beans.get(type));
    }

    @Override
    public int hashCode() {
        return beans.hashCode();
    }

    @Override
    public boolean equals(Object o) {
        return beans.equals(o);
    }

    @Override
    public Object clone() throws CloneNotSupportedException {
        return super.clone();
    }

    @Override
    public String toString() {
        return beans.toString();
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy