Gets an object using a from clause.
@param type The type of the desired object.
@param clause The WHERE clause.
@param args The arguments for the WHERE clause.
@param <T> The type of the object.
@return The object or {@code null}
107
public static <T> T objectFromClause(Class<T> type, String clause, Object... args)
    {
        return SqlClosure.sqlExecute(c -> OrmElf.objectFromClause(c, type, clause, args));
    }
1041105
@SuppressWarnings({"unchecked", "unused"})
    public <T> T get(String key, Class<T> type) {
        try {
            return (T) state.get(key);
        } catch (ClassCastException cce) {
            return null;
        }
    }
133547
Object convertArgument(String arg, Type paramType) throws IllegalArgumentException {
		Object result = null;
		if (null == arg || "null".equals(arg)) {
			return result;
		}
		logger.debug("Try to convert {} : param = {} : {}", new Object[]{arg, paramType, paramType.getClass()});
		try { // GenericArrayType, ParameterizedType, TypeVariable<D>, WildcardType, Class
			if (ParameterizedType.class.isInstance(paramType)) {
				JavaType javaType = getJavaType(paramType);
				logger.debug("Try to convert '{}' to JavaType : '{}'", arg, paramType);
				result = getObjectMapper().readValue(arg, javaType);
				logger.debug("Conversion of '{}' to '{}' : OK", arg, paramType);
			} else if (Class.class.isInstance(paramType)) {
				Class cls = (Class) paramType;
				logger.debug("Try to convert '{}' to Class '{}'", arg, paramType);
				checkStringArgument(cls, arg);
				result = getObjectMapper().readValue(arg, cls);
				logger.debug("Conversion of '{}' to '{}' : OK", arg, paramType);
			} else { // GenericArrayType, TypeVariable<D>, WildcardType
				logger.warn("Conversion of '{}' to '{}' not yet supported", arg, paramType);
			}
		} catch (IOException ex) {
			logger.debug("Conversion of '{}' to '{}' failed", arg, paramType);
			throw new IllegalArgumentException(paramType.toString());
		}
		return result;
	}
255092
public static Type getTypeArgument(Type type, int index) {
		final Type[] typeArguments = getTypeArguments(type);
		if (null != typeArguments && typeArguments.length > index) {
			return typeArguments[index];
		}
		return null;
	}
332549
public int getSqlType(Object o) {
        if (null == o) {
            return Types.NULL;
        }
        return getSqlType(o.getClass());
    }
1232593
@Override
	public <T> T getObject(final int columnIndex, final Class<T> type) throws SQLException {
		return wrapped.getObject(columnIndex, type);
	}
1310310
public static <T> Operation<T> operation(Class<? extends T> type, Operator operator,
                                             Expression<?>... args) {
        return operation(type, operator, ImmutableList.copyOf(args));
    }
901620
public static @CheckForNull <T> T lookup(Class<T> type) {
        Jenkins j = Jenkins.getInstanceOrNull();
        return j != null ? j.lookup.get(type) : null;
    }
1226626
public <T> T querySingleTypedResult(String sql, String[] args) {
		@SuppressWarnings("unchecked")
		T result = (T) querySingleResult(sql, args);
		return result;
	}
49113
public static Class<?> getFirstTypeArgument(Type type) {
        if (type instanceof ParameterizedType) {
            ParameterizedType p = (ParameterizedType) type;
            return getRawClass(p.getActualTypeArguments()[0]);
        } else {
            return null;
        }
    }
449074
@Override
    public Predicate gt(Expression<? extends Number> arg0, Expression<? extends Number> arg1)
    {
        // TODO Auto-generated method stub
        return null;
    }
667244
@Override
	public <T> T getObject(final int columnIndex, final Class<T> type) throws SQLException {
		String columnLabel = getWrapped().getMetaData().getColumnLabel(columnIndex);

		return getObject(columnLabel, type);
	}
1260512
public <V> V getObject(final String key, final Class<V> type) {
        final Object obj = this.values.get(key);
        return type.cast(obj);
    }
878039
public <T>  T get(String name, Class<T> type){
        Object o = _getObject(name);
        return o == null ? null : type.cast(o);
    }
473070
public <T> T get(Class<T> stateType) {
		Map<Class<?>, Object> states = getStates();
		T value = getState( states, stateType );

		if ( value == null ) {
			throw new IllegalArgumentException( "Accessing state of type not enabled: " + stateType );
		}

		return value;
	}
355897
static public function clause(/* parameterized list of Clause\Base objects */)
    {
        $objClauseArray = array();

        foreach (func_get_args() as $objClause) {
            if ($objClause) {
                if (!($objClause instanceof Clause\ClauseInterface)) {
                    throw new Caller('Non-Clause object was passed in to QQ::Clause');
                } else {
                    array_push($objClauseArray, $objClause);
                }
            }
        }

        return $objClauseArray;
    }
824411
@Deprecated
  public static <T> T getStateAsObject(HalResource halResource, Class<T> type) {
    return halResource.adaptTo(type);
  }