Watch This Video
//Person.groovy
package theraldanvega
import groovy.transform.Canonical
import groovy.transform.Sortable
@Sortable(includes = ['last','first'])
@Canonical
class Person {
String first
String last
}
//app.groovy
package theraldanvega
Person p1=new Person("Katie","Vega")
Person p2=new Person("Dan","Vega")
Person p3=new Person("andy","Vega")
Person p4=new Person("Jan","Vega")
Person p5=new Person("Jason","NotaVega")
def vegas=[p1,p2,p3,p4,p5]
println vegas.toSorted()
No comments:
Post a Comment
Note: only a member of this blog may post a comment.