Function0WithIdentity.java

  1. /*
  2.  * @copyright defined in LICENSE.txt
  3.  */

  4. package hera.api.function.impl;

  5. import hera.api.function.Function0;
  6. import hera.api.function.WithIdentity;
  7. import lombok.Getter;
  8. import lombok.RequiredArgsConstructor;

  9. @RequiredArgsConstructor
  10. public class Function0WithIdentity<R> implements Function0<R>, WithIdentity {

  11.   protected final Function0<R> delegate;

  12.   @Getter
  13.   protected final String identity;

  14.   @Override
  15.   public R apply() {
  16.     return delegate.apply();
  17.   }

  18. }