java.lang.Object
org.springframework.data.cassandra.core.mapping.MapIdFactory

public class MapIdFactory extends Object
Factory class for producing implementations of given id interfaces. For restrictions on id interfaces definitions, see IdInterfaceValidator.validate(Class).
Author:
Matthew T. Adams, Mark Paluch
See Also:
  • IdInterfaceValidator.validate(Class)
  • Constructor Details

    • MapIdFactory

      public MapIdFactory()
  • Method Details

    • id

      public static <T> T id(Class<T> idInterface)
      Produces an implementation of the given id interface type using the type's class loader. For restrictions on id interfaces definitions, see IdInterfaceValidator.validate(Class). Returns an implementation of the given interface that also implements MapId, so it can be cast as such if necessary.
      Parameters:
      idInterface - The type of the id interface.
      Returns:
      An implementation of the given interface that also implements MapId.
      See Also:
      • IdInterfaceValidator.validate(Class)
    • id

      public static <T> T id(Class<T> idInterface, ClassLoader loader)
      Produces an implementation of the given class loader. For restrictions on id interfaces definitions, see IdInterfaceValidator.validate(Class). Returns an implementation of the given interface that also implements MapId, so it can be cast as such if necessary.
      Parameters:
      idInterface - The type of the id interface.
      Returns:
      An implementation of the given interface that also implements MapId.
      See Also:
      • IdInterfaceValidator.validate(Class)