Groovy web console

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

enum equals

Published 8 months ago by Gabriel Bianchi with tags enum equals
Actions  ➤ Edit in console Back to console Show/hide line numbers View recent scripts
enum AA {
  A('a'),
  B('b'),

  final String type

  public AA(String _type) {
    this.type = _type
  }
}

AA a = AA.A
AA b = AA.B

println a == a
println a == b
println a.type == a.type
println a.type == b.type