Skip to content

TypeId record should implement Comparable<TypeId> #9

Description

Nice library!

The TypeId record should implement the Comparable interface:

@Override
public int compareTo(@Nullable TypeId o) {
    if (this == o) return 0;
    if (o == null) return 1;

    return this.toString().compareTo(o.toString());
}

or something similar.

Currently, I'm writing my own Comparator class, which is kinda clunky. A built-in Comparable interface would be much better.

Thanks!

-- Kevin

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions