I want to create a class that define a string variable which can have only few predefined value.
public class Constraint{
String const; // I want this constraint value to be fixed to either of {greaterthan,lesserthan,greaterthanequalto or lesserthanequalto}
public Constraint(String const){
this.const = const;
}
}
Program should throw an error if any other value is sent. I wan to use something like enum over here, but i want to do so for Strings.