Groovy web console

subscribe to the feed Subscribe
to this
site
EnumTest (via #groovywebconsole)
tweet this snippet Tweet
this
script

EnumTest

Published 2 weeks ago by msibert
Actions  ➤ Edit in console Back to console Show/hide line numbers View recent scripts
enum TYPES{
    CREDIT_CARD,
    ATM,
    DEBIT_CARD
}

List list = [TYPES.CREDIT_CARD,TYPES.ATM,TYPES.DEBIT_CARD,TYPES.CREDIT_CARD,TYPES.DEBIT_CARD,TYPES.CREDIT_CARD]

println list.count(TYPES.ATM)
println list.count(TYPES.DEBIT_CARD)