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

ru.shemplo.snowball.stuctures.Instance Maven / Gradle / Ivy

There is a newer version: 1.3.1
Show newest version
package ru.shemplo.snowball.stuctures;


public class Instance  {
    
    public static  Instance  valueOf (T object) {
        if (object == null) {
            String message = "Unable to create Instance of NULL";
            throw new IllegalArgumentException (message);
        }
        
        return new Instance  (object);
    }
    
    private final T OBJECT;
    
    private Instance (T object) {
        this.OBJECT = object;
    }
    
    @Override
    public boolean equals (Object obj) {
        return OBJECT.equals (obj);
    }
    
    @Override
    public int hashCode () {
        return OBJECT.hashCode ();
    }
    
    public T get () {
        return OBJECT;
    }
    
    @SuppressWarnings ("unchecked")
    public final Class  getClassToken () {
        return (Class ) OBJECT.getClass ();
    }
    
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy