I am trying to create a program that creates it's own little database type thing(Just cause I want some extra stuff to do for it) and I have run into a small mishap. When I try and set the value for the value of the table, I obviously must check to see if it is the right type. In my Value class, I have the setValue function:
public void setValue(Object value){
ValueType t = getColumn().getType();
if(value instanceof t){
// Is the correct type.
}
this.value = value;
}
Where ValueType is the Enum of the types of available values. Here is the class:
public enum ValueType {
STRING, INTEGER, BOOLEAN, FLOAT
}
So that works until the line:
if(value instanceof t){
IntellIJ Idea is saying that t is an unknown class. So I am trying to make it so that t will represent a String or Integer. Thank you for your time, and help.