You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The whole idea is basically to generate overloaded methods based on additional types in the @OverloadedParam annotation of a Parameter.
Single use Example:
privatevoidfoo(@OverloadedParam({String.class, long.class}) intbar) {
//method body
}
generates:
// Source Methodprivatevoidfoo(intbar) {
//method body
}
// With String instead of intprivatevoidfoo(Stringbar) {
//method body
}
// With long instead of intprivatevoidfoo(longbar) {
//method body
}
Multiple use Exmaple:
privatevoidfoo(@OverloadedParam({String.class, long.class}) intbar, @OverloadedParam({String.class, double.class}) floatbarBar) {
//method body
}
generates
// Source Methodprivatevoidfoo(intbar, floatbarBar) {
//method body
}
privatevoidfoo(intbar, doublebarBar) {
//method body
}
privatevoidfoo(intbar, StringbarBar) {
//method body
}
privatevoidfoo(longbar, floatbarBar) {
//method body
}
privatevoidfoo(longbar, doublebarBar) {
//method body
}
privatevoidfoo(longbar, StringbarBar) {
//method body
}
privatevoidfoo(Stringbar, floatbarBar) {
//method body
}
privatevoidfoo(Stringbar, doublebarBar) {
//method body
}
privatevoidfoo(Stringbar, StringbarBar) {
//method body
}
I'm sure this annotation could save many Devs a lot of time. Especially if you apply the annotation to multiple params.
The text was updated successfully, but these errors were encountered:
The whole idea is basically to generate overloaded methods based on additional types in the
@OverloadedParam
annotation of a Parameter.Single use Example:
generates:
Multiple use Exmaple:
generates
I'm sure this annotation could save many Devs a lot of time. Especially if you apply the annotation to multiple params.
The text was updated successfully, but these errors were encountered: