Class ValueIdentityBiFunction<K,V>

java.lang.Object
org.keycloak.models.sessions.infinispan.stream.ValueIdentityBiFunction<K,V>
Type Parameters:
K - The type of the first argument (key). This parameter is ignored by the function.
V - The type of the second argument (value). This parameter is returned unchanged.
All Implemented Interfaces:
BiFunction<K,V,V>

@ProtoTypeId(65619) public final class ValueIdentityBiFunction<K,V> extends Object implements BiFunction<K,V,V>
A BiFunction implementation that returns the second argument unchanged, effectively acting as an identity function for the value parameter.

This class is used in Infinispan cache operations where a BiFunction is required but only the value needs to be preserved without any transformation. The key parameter is ignored.

The class is implemented as a stateless singleton and is serializable via Infinispan ProtoStream to support distributed cache operations in remote caches.

  • Method Details

    • getInstance

      @ProtoFactory public static <T, E> ValueIdentityBiFunction<T,E> getInstance()
      Returns the singleton instance of this function.

      This method is annotated with ProtoFactory to enable Infinispan ProtoStream serialization for remote cache operations.

      Type Parameters:
      T - The type of the key parameter
      E - The type of the value parameter
      Returns:
      The singleton instance of ValueIdentityBiFunction
    • apply

      public V apply(K k, V v)
      Returns the value parameter unchanged, ignoring the key parameter.
      Specified by:
      apply in interface BiFunction<K,V,V>
      Parameters:
      k - The key parameter (ignored)
      v - The value parameter to return
      Returns:
      The value parameter unchanged