R
RVic
I have a class which has some
public enum GGFieldName {
RLEN("[0-9]{4}"),
CHG("[\\p{Alnum}]{1}");
private String regexp;
private GGFieldName(String aRegexp) { this.regexp = aRegexp;}
public String regexp() { return this.regexp;}
}
I have another class that has a member variable:
class MyClass {
String s;
}
And s can sometimes equal say the value in the enums of my GGFieldName
class, i.e.
s.equals("RLEN") or s.equals("CHG").
How can I access then the regexp value corresponding to a given value
for s ? I have tried
s.regexp() but fo course that wont even compile. Thanks for your help.
public enum GGFieldName {
RLEN("[0-9]{4}"),
CHG("[\\p{Alnum}]{1}");
private String regexp;
private GGFieldName(String aRegexp) { this.regexp = aRegexp;}
public String regexp() { return this.regexp;}
}
I have another class that has a member variable:
class MyClass {
String s;
}
And s can sometimes equal say the value in the enums of my GGFieldName
class, i.e.
s.equals("RLEN") or s.equals("CHG").
How can I access then the regexp value corresponding to a given value
for s ? I have tried
s.regexp() but fo course that wont even compile. Thanks for your help.