Skip to content

Provide equals/hashCode/toString for fj.List<A> #14

@samreid

Description

@samreid

fj.List should provide a default implementation of equals, hashCode and toString that uses the .equals(), .hashCode() and .toString() implementations of its members. For instance, this equality check on the same list contents currently fails:

public class TestList { 
    public static void main( String[] args ) { 
        final java.util.List<Integer> myList = Arrays.asList( 1, 2, 3 ); 
        boolean equal = iterableList( myList ).equals( iterableList( myList ) ); 
        System.out.println( "equal = " + equal );//prints false 
    } 
} `

Discussion of this topic was provided here:
https://groups.google.com/forum/?fromgroups#!topic/functionaljava/qc5fUHOg0AU

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions