Package ushiosan.jvm

Class UAction

java.lang.Object
ushiosan.jvm.UAction

public final class UAction extends Object
  • Method Details

    • also

      @Contract("_, _ -> param1") @Nullable public static <T> T also(@Nullable T obj, @NotNull UEmptyFun.UEmptyFun1<T> action)
      Applies configuration to an object based on a local context. Returns the same object but with the configuration already applied.
      Type Parameters:
      T - object type
      Parameters:
      obj - the base object to configure
      action - the action to execute
      Returns:
      the same object but with the configuration already applied
      Throws:
      IllegalArgumentException - error if action is null
    • alsoNotNull

      @NotNull public static <T> T alsoNotNull(@NotNull T obj, @NotNull UEmptyFun.UEmptyFun1<T> action)
      Applies configuration to an object based on a local context. Returns the same object but with the configuration already applied.
      Type Parameters:
      T - object type
      Parameters:
      obj - the base object to configure
      action - the action to execute
      Returns:
      the same object but with the configuration already applied
      Throws:
      IllegalArgumentException - error if obj or action is null
    • alsoErr

      @Nullable public static <T, E extends Throwable> T alsoErr(@Nullable T obj, @NotNull UEmptyFunErr.UEmptyFunErr1<T,E> action) throws E
      Applies configuration to an object based on a local context. Returns the same object but with the configuration already applied.
      Type Parameters:
      T - object type
      E - error type
      Parameters:
      obj - the base object to configure
      action - the action to execute
      Returns:
      the same object but with the configuration already applied
      Throws:
      E - error if something goes wrong
      IllegalArgumentException - error if action is null
    • alsoErrNotNull

      @NotNull public static <T, E extends Throwable> T alsoErrNotNull(@NotNull T obj, @NotNull UEmptyFunErr.UEmptyFunErr1<T,E> action) throws E
      Applies configuration to an object based on a local context. Returns the same object but with the configuration already applied.
      Type Parameters:
      T - object type
      E - error type
      Parameters:
      obj - the base object to configure
      action - the action to execute
      Returns:
      the same object but with the configuration already applied
      Throws:
      E - error if something goes wrong
      IllegalArgumentException - error if obj or action is null
    • alsoErrSafe

      @Nullable public static <T, E extends Throwable> T alsoErrSafe(@Nullable T obj, @NotNull UEmptyFunErr.UEmptyFunErr1<T,E> action)
      Applies configuration to an object based on a local context. Returns the same object but with the configuration already applied.
      Type Parameters:
      T - object type
      E - error type
      Parameters:
      obj - the base object to configure
      action - the action to execute
      Returns:
      the same object but with the configuration already applied
      Throws:
      IllegalArgumentException - error if action is null
    • alsoErrSafeNotNull

      @NotNull public static <T, E extends Throwable> T alsoErrSafeNotNull(@NotNull T obj, @NotNull UEmptyFunErr.UEmptyFunErr1<T,E> action)
      Applies configuration to an object based on a local context. Returns the same object but with the configuration already applied.
      Type Parameters:
      T - object type
      E - error type
      Parameters:
      obj - the base object to configure
      action - the action to execute
      Returns:
      the same object but with the configuration already applied
      Throws:
      IllegalArgumentException - error if obj or action is null
    • apply

      public static <R, T> R apply(@Nullable T obj, @NotNull UFun.UFun1<R,T> action)
      Applies configuration to an object based on a local context. Returns a different object depending on the applied configuration.
      Type Parameters:
      T - object type
      R - result type
      Parameters:
      obj - the base object to configure
      action - the action to execute
      Returns:
      a different object depending on the applied configuration.
      Throws:
      IllegalArgumentException - error if action is null
    • applyNotNull

      public static <R, T> R applyNotNull(@NotNull T obj, @NotNull UFun.UFun1<R,T> action)
      Applies configuration to an object based on a local context. Returns a different object depending on the applied configuration.
      Type Parameters:
      T - object type
      R - result type
      Parameters:
      obj - the base object to configure
      action - the action to execute
      Returns:
      a different object depending on the applied configuration.
      Throws:
      IllegalArgumentException - error if obj or action is null
    • applyErr

      public static <R, T, E extends Throwable> R applyErr(@Nullable T obj, @NotNull UFunErr.UFunErr1<R,T,E> action) throws E
      Applies configuration to an object based on a local context. Returns a different object depending on the applied configuration.
      Type Parameters:
      T - object type
      R - result type
      E - error type
      Parameters:
      obj - the base object to configure
      action - the action to execute
      Returns:
      a different object depending on the applied configuration.
      Throws:
      E - error if something goes wrong
      IllegalArgumentException - error if action is null
    • applyErrNotNull

      public static <R, T, E extends Throwable> R applyErrNotNull(@NotNull T obj, @NotNull UFunErr.UFunErr1<R,T,E> action) throws E
      Applies configuration to an object based on a local context. Returns a different object depending on the applied configuration.
      Type Parameters:
      T - object type
      R - result type
      E - error type
      Parameters:
      obj - the base object to configure
      action - the action to execute
      Returns:
      a different object depending on the applied configuration.
      Throws:
      IllegalArgumentException - error if obj or action is null
      E - error if action goes wrong
    • applyErrSafe

      @NotNull public static <R, T, E extends Throwable> @NotNull Optional<R> applyErrSafe(@Nullable T obj, @NotNull UFunErr.UFunErr1<R,T,E> action)
      Applies configuration to an object based on a local context. Returns a different object depending on the applied configuration.
      Type Parameters:
      T - object type
      R - result type
      E - error type
      Parameters:
      obj - the base object to configure
      action - the action to execute
      Returns:
      a different object depending on the applied configuration.
    • applyErrSafeNotNull

      @NotNull public static <R, T, E extends Throwable> @NotNull Optional<R> applyErrSafeNotNull(@NotNull T obj, @NotNull UFunErr.UFunErr1<R,T,E> action)
      Applies configuration to an object based on a local context. Returns a different object depending on the applied configuration.
      Type Parameters:
      T - object type
      R - result type
      E - error type
      Parameters:
      obj - the base object to configure
      action - the action to execute
      Returns:
      a different object depending on the applied configuration.