Class StringKeyedMapExecutor


public class StringKeyedMapExecutor extends AbstractStringKeyedMapLogic<Sink,Object>
A convenience class for creating a map as executor.
Since:
2.2.0
  • Constructor Details

    • StringKeyedMapExecutor

      @SafeVarargs public StringKeyedMapExecutor(Map<String,Sink> map, Sink defaultLogic, Map.Entry<String,Sink>... logics)
      Creates an instance of StringKeyedMapExecutor
      Parameters:
      map - An external map that will be used as storage of logics.
      defaultLogic - The default create logic if the key used was not in the map.
      logics - An arrays of create logic mapped to key.
    • StringKeyedMapExecutor

      @SafeVarargs public StringKeyedMapExecutor(Sink defaultLogic, Map.Entry<String,Sink>... logics)
      Creates an instance of StringKeyedMapExecutor
      Parameters:
      defaultLogic - The default create logic if the key used was not in the map.
      logics - An arrays of create logic mapped to key.
    • StringKeyedMapExecutor

      @SafeVarargs public StringKeyedMapExecutor(Map.Entry<String,Sink>... logics)
      Creates an instance of StringKeyedMapExecutor
      Parameters:
      logics - An arrays of create logic mapped to key.
    • StringKeyedMapExecutor

      public StringKeyedMapExecutor(Map<String,Sink> map)
      Creates an instance of StringKeyedMapExecutor
      Parameters:
      map - An external map that already contains logics.
  • Method Details

    • handleDefaultLogicConstructorArgument

      protected Sink handleDefaultLogicConstructorArgument(Sink defaultLogic)
      Description copied from class: AbstractKeyedMapLogic
      Must have the implementation to handle the null defaultLogic.
      Specified by:
      handleDefaultLogicConstructorArgument in class AbstractKeyedMapLogic<String,Sink,Object>
      Parameters:
      defaultLogic - The default argument received from the constructor.
      Returns:
      The initial value of the internal defaultLogic.
    • get

      public Optional<Object> get(String key)
      This will always return empty values. Use the execute method instead to perform any logic.
      Specified by:
      get in class AbstractStringKeyedMapLogic<Sink,Object>
      Parameters:
      key - The target key of the corresponding logic.
      Returns:
      Always empty.
    • execute

      public void execute(String key)
      Executes the logic that corresponds to a particular key.
      Parameters:
      key - The target key of the corresponding logic.