Do we support the use of static code analysis for Xtend language? So spoiled by Java language variety set of code analysis tools and miss stuff like cyclomatic complexity.
--
You received this message because you are subscribed to the Google Groups "Xtend Programming Language" group.
To unsubscribe from this group and stop receiving emails from it, send an email to xtend-lang+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
public enum ContactSourceSelect implements ValidString {
HOT {
@Override
boolean match(final Integer condition) {
return Integer.valueOf(1).equals(condition);
}
@Override
public String valid() {
return "Hot";
}
},
WARM {
@Override
boolean match(final Integer condition) {
return Integer.valueOf(2).equals(condition);
}
@Override
public String valid() {
return "Warm";
}
},
COLD {
@Override
boolean match(final Integer condition) {
return Integer.valueOf(3).equals(condition);
}
@Override
public String valid() {
return "Cold";
}
},
NEW {
@Override
boolean match(final Integer condition) {
return Integer.valueOf(4).equals(condition);
}
@Override
public String valid() {
return "New";
}
},
SOLD {
@Override
boolean match(final Integer condition) {
return Integer.valueOf(5).equals(condition);
}
@Override
public String valid() {
return "Sold";
}
},
TRASH {
@Override
boolean match(Integer condition) {
return Integer.valueOf(6).equals(condition);
}
@Override
public String valid() {
return "Trash";
}
},
DEFAULT {
@Override
boolean match(Integer condition) {
return Boolean.TRUE.booleanValue();
}
@Override
public String valid() {
return "";
}
};
public static ContactSourceSelect parse(final Integer condition) {
for (ContactSourceSelect type : values()) {
if (type.match(condition)) {
return type;
}
}
return DEFAULT;
}
abstract boolean match(final Integer condition);
}
public interface ValidString {
String valid();
}
You can use any java-specific tool, on the generated code or the byte code.
2017-07-25 0:13 GMT+02:00 Manav Brar <manav...@gmail.com>:
Do we support the use of static code analysis for Xtend language? So spoiled by Java language variety set of code analysis tools and miss stuff like cyclomatic complexity.
--
You received this message because you are subscribed to the Google Groups "Xtend Programming Language" group.
To unsubscribe from this group and stop receiving emails from it, send an email to xtend-lang+...@googlegroups.com.