Skip to content

How to diff immutable record types? #167

@DanielJonesEB

Description

@DanielJonesEB

I want to diff immutable record types (classes with public final members, and object identity dependent on all such members). I don't need to merge, I just need to see what the differences are between them.

I've looked at Instrospector and the StandardIntrospector implementation, but TypeInfo requires accessors to be provided, which my classes don't have.

public class Service
{
    public final String name;
    public final Map<String, String> credentials;

    public Service(String name, Map<String, String> credentials)
    {
        this.name = name;
        this.credentials = Collections.unmodifiableMap(credentials);
    }

    //hashCode and equals on both properties
}

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