Class RebindMode

java.lang.Object
ch.tocco.nice2.rest.entity.spi.rebind.RebindMode

public class RebindMode extends Object
Controls the way the EntityBeans are applied to the Entities.
  • Field Details

  • Constructor Details

    • RebindMode

      public RebindMode()
  • Method Details

    • with

      public <T> RebindMode with(RebindMode.Key<T> key, T value)
      Add a key value pair to this mode.
      Type Parameters:
      T - The type of the value.
      Parameters:
      key - The key.
      value - The value.
      Returns:
      the mode.
    • entityHandling

      public RebindMode entityHandling(EntityHandling entityHandling)
    • get

      public <T> Optional<T> get(RebindMode.Key<T> key)
      Get a value for a specific key.
      Type Parameters:
      T - The type of the value.
      Parameters:
      key - The key of the value.
      Returns:
      the value or Optional.empty() if not set or null.
    • entityHandling

      public EntityHandling entityHandling()
    • key

      public static <T> RebindMode.Key<T> key(String name, Class<T> type)
      Create a key instance.
      Parameters:
      name - The name of the key.
      type - The type for the value.
      Returns:
      the key instance.