Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Groovy bean one with handcrafted comparison
package delegation
import groovy.transform.TupleConstructor
class BeanOne implements Comparable<BeanOne> {
String firstName
String familyName
public String getFullName() {
return "$firstName $familyName"
int compareTo(BeanOne o) {
if (!o) return false
if ( return false
return fullName <=> o.fullName
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment