I want to create an annotation that can accept a p...
# announcements
a
I want to create an annotation that can accept a param with different types.
Copy code
annotation class Decimal(val value: Int)
I mean the
value
type could be for example,
Int
,
BigInteger
, or
BigDecimal
What do you think the best approach to do this?
k
Annotations can't accept
BigInteger
can they? You could accept a string
a
you are right,
BigInteger
and
BigDecimal
are not supported.
but what if I want to make it accept
Int
and
Short
for example?
I think I will go with the string and parse it, but was looking if there is a better approach