Class IdentityKeyFunction<E>

java.lang.Object
com.github.andrewoma.dexx.collection.IdentityKeyFunction<E>
All Implemented Interfaces:
KeyFunction<E,E>

public class IdentityKeyFunction<E> extends Object implements KeyFunction<E,E>
IdentityKeyFunction is a KeyFunction where the value can be used as a key.

This is useful in DerivedKeyHashMap instances where the value defines equals() and hashCode() methods that only use the key.

  • Constructor Details

    • IdentityKeyFunction

      public IdentityKeyFunction()
  • Method Details

    • key

      @NotNull public E key(@NotNull E value)
      Specified by:
      key in interface KeyFunction<E,E>