Converts wire type to proto type.

@param aclAction the acl action to convert
@return {@link File.PSetAclAction} equivalent
765741
public static File.PSetAclAction toProto(SetAclAction aclAction) {
    switch (aclAction) {
      case REPLACE:
        return File.PSetAclAction.REPLACE;
      case MODIFY:
        return File.PSetAclAction.MODIFY;
      case REMOVE:
        return File.PSetAclAction.REMOVE;
      case REMOVE_ALL:
        return File.PSetAclAction.REMOVE_ALL;
      case REMOVE_DEFAULT:
        return File.PSetAclAction.REMOVE_DEFAULT;
      default:
        throw new IllegalStateException("Unrecognized set acl action: " + aclAction);
    }
  }
307756
public static <T> ActionPredicate<T> fromPredicate(final Predicate<T> predicate) {
	return new ActionPredicate<T>() {
	    public boolean actionPredicate(T obj) {
		return predicate.check(obj);
	    }
	};
    }
413382
@Nonnull
	public <V extends T> LTieCharFunctionBuilder<T> aCase(Class<V> argC1, LTieCharFunction<V> function) {
		PartialCaseWithIntProduct.The pc = partialCaseFactoryMethod((a1, a2, a3) -> (argC1 == null || argC1.isInstance(a1)));

		pc.evaluate(function);
		return self();
	}
426808
Object toSimpleValue(Class<?> genericType, Object element, TypeAdapters typeAdapters) {
        if (element == null) {
            return null;
        }
        log.info("Convert from " + element.getClass().getName() + " to " + genericType.getName());
        if (genericType.isEnum() && (element instanceof String)) {
            @SuppressWarnings({ "unchecked", "rawtypes" })
            Enum<?> enumValue = Enum.valueOf((Class<? extends Enum>) genericType, (String) element);
            return enumValue;
        }
        Converter converter = SIMPLE_VALUE_CONVERTERS.get(genericType.getName());
        if (converter != null) {
            return converter.convert(element);
        }
        if ((element instanceof String) && (typeAdapters != null)) {
            TypeAdapter<?> adapter = typeAdapters.getTypeAdapter(genericType);
            if (adapter != null) {
                return adapter.deserialize((String) element);
            }
        }
        return element;
    }
1201956
public static JcrAccessControlList defaultAcl( AccessControlManagerImpl acm ) {
        JcrAccessControlList acl = new JcrAccessControlList("/");
        try {
            acl.principals.put(SimplePrincipal.EVERYONE, new AccessControlEntryImpl(SimplePrincipal.EVERYONE, acm.privileges()));
        } catch (AccessControlException e) {
            // will never happen
        }
        return acl;
    }
1195613
public java.util.List<alluxio.grpc.PAclAction> getActionsList() {
    return new com.google.protobuf.Internal.ListAdapter<
        java.lang.Integer, alluxio.grpc.PAclAction>(actions_, actions_converter_);
  }
935087
@Nonnull
	public <V extends T> LToDblFunctionBuilder<T> aCase(Class<V> argC, LToDblFunction<V> function) {
		PartialCaseWithDblProduct.The pc = partialCaseFactoryMethod(a -> (argC == null || argC.isInstance(a)));

		pc.evaluate(function);
		return self();
	}
643006
public static PTtlAction toProtobuf(TtlAction ttlAction) {
    if (ttlAction == null) {
      return PTtlAction.DELETE;
    }
    switch (ttlAction) {
      case DELETE:
        return PTtlAction.DELETE;
      case FREE:
        return PTtlAction.FREE;
      default:
        throw new IllegalStateException("Unknown ttl action: " + ttlAction);
    }
  }
772592
public static Xml exports(Collection<ActionRef> actions)
    {
        Check.notNull(actions);

        final Xml node = new Xml(NODE_ACTIONS);

        for (final ActionRef action : actions)
        {
            final Xml nodeAction = node.createChild(NODE_ACTION);
            nodeAction.writeString(ATT_PATH, action.getPath());
            if (action.hasCancel())
            {
                nodeAction.writeBoolean(ATT_CANCEL, true);
            }
            for (final ActionRef ref : action.getRefs())
            {
                exports(nodeAction, ref);
            }
        }

        return node;
    }
269676
@Nonnull
	public <V extends T> BinaryOperatorBuilder<T> aCase(Class<V> argC1, Class<V> argC2, BinaryOperator<V> function) {
		PartialCaseWithProduct.The pc = partialCaseFactoryMethod((a1, a2) -> (argC1 == null || argC1.isInstance(a1)) && (argC2 == null || argC2.isInstance(a2)));

		pc.evaluate(function);
		return self();
	}
543004
@Nonnull
	public <V extends T> PredicateBuilder<T> aCase(Class<V> argC, Predicate<V> function) {
		PartialCaseWithBoolProduct.The pc = partialCaseFactoryMethod(a -> (argC == null || argC.isInstance(a)));

		pc.evaluate(function);
		return self();
	}
776508
function parseAction ({ action, payload={}, error=false }) {
  switch (typeof action) {
    // If it's an action creator, create the action
    case 'function': return action(payload)
    // If it's an action object return the action
    case 'object': return action
    // Otherwise, create a "default" action object with the given type
    case 'string': return { type: action, payload, error }
    default: throw new Error('Invalid action definition (must be function, object or string).')
  }
}
384215
public static MgmtActionType convertActionType(final ActionType actionType) {
        if (actionType == null) {
            return null;
        }

        switch (actionType) {
        case SOFT:
            return MgmtActionType.SOFT;
        case FORCED:
            return MgmtActionType.FORCED;
        case TIMEFORCED:
            return MgmtActionType.TIMEFORCED;
        case DOWNLOAD_ONLY:
            return MgmtActionType.DOWNLOAD_ONLY;
        default:
            throw new IllegalStateException("Action Type is not supported");
        }
    }
1181110
Type instantiateMethod( Env<AttrContext> env,
                            List<Type> tvars,
                            MethodType mt,
                            Attr.ResultInfo resultInfo,
                            MethodSymbol msym,
                            List<Type> argtypes,
                            boolean allowBoxing,
                            boolean useVarargs,
                            Resolve.MethodResolutionContext resolveContext,
                            Warner warn) throws InferenceException {
        //-System.err.println("instantiateMethod(" + tvars + ", " + mt + ", " + argtypes + ")"); //DEBUG
        final InferenceContext inferenceContext = new InferenceContext(this, tvars);  //B0
        inferenceException.clear();
        try {
            DeferredAttr.DeferredAttrContext deferredAttrContext =
                        resolveContext.deferredAttrContext(msym, inferenceContext, resultInfo, warn);

            resolveContext.methodCheck.argumentsAcceptable(env, deferredAttrContext,   //B2
                    argtypes, mt.getParameterTypes(), warn);

            if (allowGraphInference && resultInfo != null && resultInfo.pt == anyPoly) {
                doIncorporation(inferenceContext, warn);
                //we are inside method attribution - just return a partially inferred type
                return new PartiallyInferredMethodType(mt, inferenceContext, env, warn);
            } else if (allowGraphInference && resultInfo != null) {

                //inject return constraints earlier
                doIncorporation(inferenceContext, warn); //propagation

                if (!warn.hasNonSilentLint(Lint.LintCategory.UNCHECKED)) {
                    boolean shouldPropagate = shouldPropagate(mt.getReturnType(), resultInfo, inferenceContext);

                    InferenceContext minContext = shouldPropagate ?
                            inferenceContext.min(roots(mt, deferredAttrContext), true, warn) :
                            inferenceContext;

                    Type newRestype = generateReturnConstraints(env.tree, resultInfo,  //B3
                            mt, minContext);
                    mt = (MethodType)types.createMethodTypeWithReturn(mt, newRestype);

                    //propagate outwards if needed
                    if (shouldPropagate) {
                        //propagate inference context outwards and exit
                        minContext.dupTo(resultInfo.checkContext.inferenceContext());
                        deferredAttrContext.complete();
                        return mt;
                    }
                }
            }

            deferredAttrContext.complete();

            // minimize as yet undetermined type variables
            if (allowGraphInference) {
                inferenceContext.solve(warn);
            } else {
                inferenceContext.solveLegacy(true, warn, LegacyInferenceSteps.EQ_LOWER.steps); //minimizeInst
            }

            mt = (MethodType)inferenceContext.asInstType(mt);

            if (!allowGraphInference &&
                    inferenceContext.restvars().nonEmpty() &&
                    resultInfo != null &&
                    !warn.hasNonSilentLint(Lint.LintCategory.UNCHECKED)) {
                generateReturnConstraints(env.tree, resultInfo, mt, inferenceContext);
                inferenceContext.solveLegacy(false, warn, LegacyInferenceSteps.EQ_UPPER.steps); //maximizeInst
                mt = (MethodType)inferenceContext.asInstType(mt);
            }

            if (resultInfo != null && rs.verboseResolutionMode.contains(VerboseResolutionMode.DEFERRED_INST)) {
                log.note(env.tree.pos, "deferred.method.inst", msym, mt, resultInfo.pt);
            }

            // return instantiated version of method type
            return mt;
        } finally {
            if (resultInfo != null || !allowGraphInference) {
                inferenceContext.notifyChange();
            } else {
                inferenceContext.notifyChange(inferenceContext.boundedVars());
            }
            if (resultInfo == null) {
                /* if the is no result info then we can clear the capture types
                 * cache without affecting any result info check
                 */
                inferenceContext.captureTypeCache.clear();
            }
            dumpGraphsIfNeeded(env.tree, msym, resolveContext);
        }
    }
1239363
public static QrCodeCreateResult qrcodeCreate(String accessToken,
			QrCodeCreateMultiple action) {
		return qrcodeCreate(accessToken, JsonUtil.toJSONString(action));
	}
58908
@Nonnull
	public <V extends T> LOiToCharFunctionBuilder<T> aCase(Class<V> argC1, LOiToCharFunction<V> function) {
		PartialCaseWithCharProduct.The pc = partialCaseFactoryMethod((a1, a2) -> (argC1 == null || argC1.isInstance(a1)));

		pc.evaluate(function);
		return self();
	}
481007
public static <T> T
        doPrivileged(PrivilegedExceptionAction<T> action)
        throws PrivilegedActionException {
        try {
            return action.run();
        } catch (RuntimeException e) {
            throw e;
        } catch (Exception e) {
            throw new PrivilegedActionException(e);
        }
    }