Converts an {@link Action2} to a function that calls the action and returns {@code null}.

@param action the {@link Action2} to convert
@return a {@link Func2} that calls {@code action} and returns {@code null}
490701
public static <T1, T2> Func2<T1, T2, Void> toFunc(final Action2<T1, T2> action) {
        return toFunc(action, (Void) null);
    }
736766
public static <A> FutureCallback<A> onFailureDo(final Action<Throwable> action) {
        return futureCallback(Actions.<A>nothing(), action);
    }
285386
public void setAction(String action)
    {
        ExtendedInfo info = getInfo(action);
        if (info != null)
            info._action = action;
    }
393028
public static TaskTrackerAction createAction(ActionType actionType) {
    TaskTrackerAction action = null;
    
    switch (actionType) {
    case LAUNCH_TASK:
      {
        action = new LaunchTaskAction();
      }
      break;
    case KILL_TASK:
      {
        action = new KillTaskAction();
      }
      break;
    case KILL_JOB:
      {
        action = new KillJobAction();
      }
      break;
    case REINIT_TRACKER:
      {
        action = new ReinitTrackerAction();
      }
      break;
    case COMMIT_TASK:
      {
        action = new CommitTaskAction();
      }
      break;
    }

    return action;
  }
407147
private <T extends SeleniumAction> T action(T delegate) {
        if (seleniumBrowser != null) {
            delegate.setBrowser(seleniumBrowser);
        }

        action.setDelegate(delegate);
        return delegate;
    }
978898
public static Result onUiAsync(Action action) {
        if (Looper.myLooper() == Looper.getMainLooper()) {
            action.call();
            return new ActionAsyncTask(action, true);
        }
        ActionAsyncTask task = new ActionAsyncTask(action);
        getUiPoster().async(task);
        return task;
    }
211714
public <T> Action1<T> getOnNextAction() {
    return new Action1<T>() {
      @Override
      public void call(T objectt) {
        if (operationTime == null) {
          operationTime = new Date().getTime();
        }
      }
    };
  }
280495
@Local
    public CompletableFuture<Integer> broadcastAction(final WebSocketAction action) {
        if (this.localEngine != null && this.sncpNodeAddresses == null) { //本地模式且没有分布式
            return this.localEngine.broadcastLocalAction(action);
        }
        CompletableFuture<Integer> localFuture = this.localEngine == null ? null : this.localEngine.broadcastLocalAction(action);
        tryAcquireSemaphore();
        CompletableFuture<Collection<InetSocketAddress>> addrsFuture = sncpNodeAddresses.getCollectionAsync(SOURCE_SNCP_ADDRS_KEY, InetSocketAddress.class);
        if (semaphore != null) addrsFuture.whenComplete((r, e) -> releaseSemaphore());
        CompletableFuture<Integer> remoteFuture = addrsFuture.thenCompose((Collection<InetSocketAddress> addrs) -> {
            if (logger.isLoggable(Level.FINEST)) logger.finest("websocket broadcast action (" + action + ") on " + addrs);
            if (addrs == null || addrs.isEmpty()) return CompletableFuture.completedFuture(0);
            CompletableFuture<Integer> future = null;
            for (InetSocketAddress addr : addrs) {
                if (addr == null || addr.equals(localSncpAddress)) continue;
                future = future == null ? remoteNode.broadcastAction(addr, action)
                    : future.thenCombine(remoteNode.broadcastAction(addr, action), (a, b) -> a | b);
            }
            return future == null ? CompletableFuture.completedFuture(0) : future;
        });
        return localFuture == null ? remoteFuture : localFuture.thenCombine(remoteFuture, (a, b) -> a | b);
    }
1327314
public static ProcessorActionHandler getHandler(ProcessorAction action) {
        ProcessorActionHandler ret = null;
        Class<? extends ProcessorActionHandler> cls = handlers.get(action.getClass());
        if (cls != null) {
            try {
                Constructor<? extends ProcessorActionHandler> con = cls.getConstructor(ProcessorAction.class);
                ret = con.newInstance(action);
            } catch (Exception e) {
                log.log(Level.SEVERE, "Failed to instantiate handler for action '" + action + "'", e);
            }
        }
        return ret;
    }
1136669
public void setAction(String action) throws ApplicationException {
	action = action.toLowerCase().trim();
	if (action.equals("getall")) this.action = ACTION_GET_ALL;
	else if (action.equals("get")) this.action = ACTION_GET;
	else if (action.equals("set")) this.action = ACTION_SET;
	else if (action.equals("delete")) this.action = ACTION_DELETE;
	else throw new ApplicationException("attribute action of the tag registry has an invalid value [" + action + "], valid values are [getAll, get, set, delete]");
    }
562003
@Override
    public void doAction(Action action) {
        BaseComponent parent = getParent();
        
        switch (action) {
            case REMOVE:
                ActionListener.unbindActionListeners(this, actionListeners);
                detach();
                break;
            
            case HIDE:
            case COLLAPSE:
                setVisible(false);
                break;
            
            case SHOW:
            case EXPAND:
                setVisible(true);
                break;
            
            case TOP:
                parent.addChild(this, 0);
                break;
        }
        
        if (parent != null) {
            EventUtil.post(MainController.ALERT_ACTION_EVENT, parent, action);
        }
    }
715696
@Override
	public Action getAction(String name, String nodeID) {
		Strategy<ActionEndpoint> strategy = null;
		long stamp = lock.tryOptimisticRead();
		if (stamp != 0) {
			try {
				strategy = strategies.get(name);
			} catch (Exception modified) {
				stamp = 0;
			}
		}
		if (!lock.validate(stamp) || stamp == 0) {
			stamp = lock.readLock();
			try {
				strategy = strategies.get(name);
			} finally {
				lock.unlockRead(stamp);
			}
		}
		if (strategy == null) {
			throw new ServiceNotFoundError(nodeID, name);
		}
		ActionEndpoint endpoint = strategy.getEndpoint(nodeID);
		if (endpoint == null) {
			throw new ServiceNotAvailableError(nodeID, name);
		}
		return endpoint;
	}
108474
function _createAction(action) {
  if (_isString(action)) {
    action = {
      destination: action,
    }
  }
  if (_isObject(action)) {
    action = (function() {
      const openNewTab = action.openNewTab
      const destination = action.destination
      return function() {
        if (openNewTab) {
          window.open(destination, '_blank')
        } else {
          window.location.href = destination
        }
      }
    })()
  }

  return action
}
284796
@Override
    public boolean validateAction(String action) {
        boolean result = false;
        if (action.equals(MessagingSecurityConstants.OPERATION_TYPE_SEND) ||
            action.equals(MessagingSecurityConstants.OPERATION_TYPE_RECEIVE)) {
            result = true;
        }
        return result;
    }
22195
public static Result onBackground(Action action) {
        final HandlerPoster poster = getBackgroundPoster();
        if (Looper.myLooper() == poster.getLooper()) {
            action.call();
            return new ActionAsyncTask(action, true);
        }
        ActionAsyncTask task = new ActionAsyncTask(action);
        poster.async(task);
        return task;
    }
931533
function(action, implementation){
            this.resolvableActions                      = this.resolvableActions                        || {};
            this.resolvableActions[action]              = this.resolvableActions[action]                || {};
            this.resolvableActions[action].actionName   = this.resolvableActions[action].actionName     || action;

            implementation = implementation || RL.ResolvableAction.Types[action];
            this.resolvableActions[action] = Object.create(implementation);
            // merge could be used instead of Object.create but is less desirable
            // RL.Util.merge(this.resolvableAction.Types[action], implementation);

            if(this.resolvableActions[action].init){
                this.resolvableActions[action].init.call(this);
            }
        }
582318
public ActionResult getActionResult(String actionId) {
        if (actionId == null) {
            return null;
        }
        for (ListIterator<ContentResult> iterator = listIterator(size()); iterator.hasPrevious();) {
            ContentResult contentResult = iterator.previous();
            ActionResult actionResult = contentResult.getActionResult(actionId);
            if (actionResult != null) {
                return actionResult;
            }
        }
        return null;
    }