mardi 25 août 2015

How does this class work or how can you use it?

I fell over a class which looks like this:

public final class DatabaseType{

    public static final DatabaseType TYPE_LIMITED_TEXT = new DatabaseType();
    public static final DatabaseType TYPE_UNLIMITED_TEXT = new DatabaseType();
    public static final DatabaseType TYPE_DATE = new DatabaseType();
    public static final DatabaseType TYPE_DECIMAL = new DatabaseType();

    private DatabaseType(){
    }

    public String toString(){
        return "DatabaseType";
    }
}

I need to set the type but I want to understand what's happening here and I have no clue how this class works. Whatever variable I use it will always return an empty DatabaseType, with no information. So I wonder how you can get use of such a class. Maybe there is a name for this type of class?

Aucun commentaire:

Enregistrer un commentaire