Return a {@link Callable} that merely returns the specified value.
No exception will ever be thrown.
502214
@ReplacedBy("com.google.common.util.concurrent.Callables#returning()")
    public static <V> Callable<V> asCallable (final V value)
    {
        return new Callable<V>() {
            public V call () {
                return value;
            }
        };
    }
571034
def _value_retriever(self, value):
        
        if self._use_as_callable(value):
            return value

        return lambda item: data_get(item, value)
636755
def _wrap(self, value, priority=0):
        

        if not callable(value):
            raise TypeError("Only callable values can be stored in CallbackContainer")

        elif self.is_bound_method(value):

            # We are dealing with a bound method. Method references aren't
            # persistent, so instead we store a reference to the function
            # and instance.

            value = (weakref.ref(value.__func__),
                     weakref.ref(value.__self__, self._auto_remove),
                     priority)

        else:

            value = (value, priority)

        return value
29728
def is_callable(self):
        
        self._callable = Call(self, call_name=self._name, callable=True)
        return self
819840
def callable_validator(v: Any) -> AnyCallable:
    
    if callable(v):
        return v

    raise errors.CallableError(value=v)
153685
def from_value(value):
        
        value = ArrayConverter.to_nullable_array(value)
        if value != None:
            return AnyValueArray(value)
        return AnyValueArray()
387811
public static <T> Callable<T> privilegedCallable(Callable<T> callable) {
        if (callable == null)
            throw new NullPointerException();
        return callable;
    }
151694
public static Object call0(Callable fun, Scriptable thisObj,
                               Context cx, Scriptable scope)
    {
        return fun.call(cx, scope, thisObj, ScriptRuntime.emptyArgs);
    }
710874
public <C> Callable<C> wrap(final Callable<C> c) {
    return new Callable<C>() {
      @Override
      public C call() throws Exception {
        Context previous = attach();
        try {
          return c.call();
        } finally {
          detach(previous);
        }
      }
    };
  }
1277463
public static Object fromPersistenceType(Object value, Class<?> parameterType) {
    if (!isTypeConversionRequired(parameterType)) {
      return value;
    }
    if (Map.class.isAssignableFrom(parameterType) && (value instanceof String[])) {
      String[] rows = (String[])value;
      Map<String, String> map = new LinkedHashMap<>();
      for (int i = 0; i < rows.length; i++) {
        String[] keyValue = ConversionStringUtils.splitPreserveAllTokens(rows[i], KEY_VALUE_DELIMITER.charAt(0));
        if (keyValue.length == 2 && StringUtils.isNotEmpty(keyValue[0])) {
          String entryKey = keyValue[0];
          String entryValue = StringUtils.isEmpty(keyValue[1]) ? null : keyValue[1];
          map.put(ConversionStringUtils.decodeString(entryKey), ConversionStringUtils.decodeString(entryValue));
        }
      }
      return map;
    }
    throw new IllegalArgumentException("Type conversion not supported: " + parameterType.getName());
  }
740385
public Object call(Object value) {
        if (value == null) { return new Integer(0); }
        return new Integer(String.valueOf(value).length());
    }
111909
public static <T> Optional<T> of(final T value) throws NullPointerException {
        if (value == null) {
            throw new NullPointerException("A null value was passed which is not allowed to be null."
                    + " Use #ofNullable(T) if the value can be null.");
        }
        return new Optional<T>(value);
    }
992444
public static <T> T call(Callable<T> c)
   {
      if (c == null)
      {
         return null;
      }
      try
      {
         return c.call();
      }
      catch (RuntimeException e)
      {
         throw e;
      }
      catch (Exception e)
      {
         throw new RuntimeException("Error invoking Callable [c]", e);
      }
   }
1364565
public <T> T checkSucceeds(Callable<T> callable) {
        try {
            return callable.call();
        } catch (AssumptionViolatedException e) {
            AssertionError error = new AssertionError("Callable threw AssumptionViolatedException");
            error.initCause(e);
            addError(error);
            return null;
        } catch (Throwable e) {
            addError(e);
            return null;
        }
    }
364209
public static <R> R beatAroundTheBush(Callable<R> callable) {
        try {
            return callable.call();
        } catch (Exception e) {
            throw new RuntimeException(e);
        }
    }
102147
def from_value(value):
        
        if isinstance(value, PagingParams):
            return value
        if isinstance(value, AnyValueMap):
            return PagingParams.from_map(value)
        
        map = AnyValueMap.from_value(value)
        return PagingParams.from_map(map)
1226852
@SuppressWarnings("unchecked")
	public static Map<String, Object> toNullableMap(Object value) {
		if (value == null)
			return null;

		Class<?> valueClass = value.getClass();
		if (valueClass.isPrimitive())
			return null;

		if (value instanceof Map<?, ?>)
			return mapToMap((Map<Object, Object>) value);

		if (valueClass.isArray())
			return arrayToMap((Object[]) value);

		if (value instanceof Collection<?>)
			return listToMap((Collection<Object>) value);

		try {
			return mapper.convertValue(value, typeRef);
		} catch (Exception ex) {
			return null;
		}
	}