本文整理汇总了Java中com.google.common.collect.ObjectArrays.concat方法的典型用法代码示例。如果您正苦于以下问题:Java ObjectArrays.concat方法的具体用法?Java ObjectArrays.concat怎么用?Java ObjectArrays.concat使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.google.common.collect.ObjectArrays
的用法示例。
在下文中一共展示了ObjectArrays.concat方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: run
import com.google.common.collect.ObjectArrays; //导入方法依赖的package包/类
public boolean run(String actionName, Profiler profiler,
String[] args) {
monitor.outcomeStarted(this, testClass.getName(), actionName);
String[] arguments = ObjectArrays.concat(testClass.getName(), args);
if (profile) {
arguments = ObjectArrays.concat("--debug", arguments);
}
try {
if (profiler != null) {
profiler.start();
}
new Runner().run(arguments);
} catch (Exception ex) {
ex.printStackTrace();
} finally {
if (profiler != null) {
profiler.stop();
}
}
monitor.outcomeFinished(Result.SUCCESS);
return true;
}
示例2: throwCause
import com.google.common.collect.ObjectArrays; //导入方法依赖的package包/类
private static Exception throwCause(Exception e, boolean combineStackTraces) throws Exception {
Throwable cause = e.getCause();
if (cause == null) {
throw e;
}
if (combineStackTraces) {
StackTraceElement[] combined =
ObjectArrays.concat(cause.getStackTrace(), e.getStackTrace(), StackTraceElement.class);
cause.setStackTrace(combined);
}
if (cause instanceof Exception) {
throw (Exception) cause;
}
if (cause instanceof Error) {
throw (Error) cause;
}
// The cause is a weird kind of Throwable, so throw the outer exception.
throw e;
}
示例3: throwCause
import com.google.common.collect.ObjectArrays; //导入方法依赖的package包/类
private static Exception throwCause(Exception e, boolean combineStackTraces) throws Exception {
Throwable cause = e.getCause();
if (cause == null) {
throw e;
}
if (combineStackTraces) {
StackTraceElement[] combined = ObjectArrays.concat(cause.getStackTrace(), e.getStackTrace(), StackTraceElement.class);
cause.setStackTrace(combined);
}
if (cause instanceof Exception) {
throw (Exception) cause;
}
if (cause instanceof Error) {
throw (Error) cause;
}
// The cause is a weird kind of Throwable, so throw the outer exception.
throw e;
}
示例4: getLatestRatingPageCount
import com.google.common.collect.ObjectArrays; //导入方法依赖的package包/类
public int getLatestRatingPageCount(int tenantId, int itemTypeId, Date since) {
final StringBuilder query = new StringBuilder("SELECT CEIL(count(*) / ?)");
query.append("\n");
query.append("FROM ").append(DEFAULT_TABLE_NAME).append("\n");
query.append("WHERE ");
query.append(DEFAULT_TENANT_COLUMN_NAME).append(" = ? AND ");
query.append(DEFAULT_ITEM_TYPE_COLUMN_NAME).append(" = ?");
Object[] args = new Object[]{PAGE_SIZE, tenantId, itemTypeId};
int[] argt = new int[]{Types.INTEGER, Types.INTEGER, Types.INTEGER};
if (since != null) {
query.append(" AND ").append(DEFAULT_ACTION_TIME_COLUMN_NAME).append(" > ?");
args = ObjectArrays.concat(args, since);
argt = Ints.concat(argt, new int[]{Types.TIMESTAMP});
}
int count = getJdbcTemplate().queryForInt(query.toString(), args, argt);
return count;
}
示例5: getByIssueKeys
import com.google.common.collect.ObjectArrays; //导入方法依赖的package包/类
@Override
public List<RepositoryPullRequestMapping> getByIssueKeys(final Iterable<String> issueKeys)
{
Collection<Integer> prIds = findRelatedPullRequests(issueKeys);
if (prIds.isEmpty())
{
return Lists.newArrayList();
}
final String whereClause = ActiveObjectsUtils.renderListOperator("pr.ID", "IN", "OR", prIds).toString();
final Object [] params = ObjectArrays.concat(new Object[]{Boolean.FALSE, Boolean.TRUE}, prIds.toArray(), Object.class);
Query select = Query.select()
.alias(RepositoryMapping.class, "repo")
.alias(RepositoryPullRequestMapping.class, "pr")
.join(RepositoryMapping.class, "repo.ID = pr." + RepositoryPullRequestMapping.TO_REPO_ID)
.where("repo." + RepositoryMapping.DELETED + " = ? AND repo." + RepositoryMapping.LINKED + " = ? AND " + whereClause, params);
return Arrays.asList(activeObjects.find(RepositoryPullRequestMapping.class, select));
}
示例6: addNatureToProjectDescription
import com.google.common.collect.ObjectArrays; //导入方法依赖的package包/类
public static IStatus addNatureToProjectDescription(IProjectDescription description, String natureId) {
String[] natureIds = description.getNatureIds();
// calculate new nature IDs
if (Arrays.asList(natureIds).contains(natureId)) {
return Status.OK_STATUS;
}
natureIds = ObjectArrays.concat(description.getNatureIds(), natureId);
// validate the natures
IWorkspace workspace = ResourcesPlugin.getWorkspace();
IStatus validationResult = workspace.validateNatureSet(natureIds);
if (validationResult.getCode() == IStatus.OK) {
description.setNatureIds(natureIds);
}
return validationResult;
}
示例7: throwCause
import com.google.common.collect.ObjectArrays; //导入方法依赖的package包/类
private static Exception throwCause(Exception e, boolean combineStackTraces)
throws Exception {
Throwable cause = e.getCause();
if (cause == null) {
throw e;
}
if (combineStackTraces) {
StackTraceElement[] combined = ObjectArrays.concat(cause.getStackTrace(),
e.getStackTrace(), StackTraceElement.class);
cause.setStackTrace(combined);
}
if (cause instanceof Exception) {
throw (Exception) cause;
}
if (cause instanceof Error) {
throw (Error) cause;
}
// The cause is a weird kind of Throwable, so throw the outer exception.
throw e;
}
示例8: getItemTypeIds
import com.google.common.collect.ObjectArrays; //导入方法依赖的package包/类
public List<Integer> getItemTypeIds(Integer tenantId, Boolean visible) {
Preconditions.checkNotNull(tenantId, "missing constraints: missing 'tenantId'");
Object[] args = new Object[]{tenantId};
int[] argTypes = new int[]{Types.INTEGER};
StringBuilder sqlString = new StringBuilder("SELECT ");
sqlString.append(DEFAULT_ID_COLUMN_NAME);
sqlString.append(" FROM ");
sqlString.append(DEFAULT_TABLE_NAME);
sqlString.append(" WHERE ");
sqlString.append(DEFAULT_TENANT_COLUMN_NAME);
sqlString.append(" =?");
if (visible != null) {
sqlString.append(" AND ").append(DEFAULT_VISIBLE_COLUMN_NAME).append("=?");
args = ObjectArrays.concat(args, visible);
argTypes = Ints.concat(argTypes, new int[]{Types.BIT});
}
return getJdbcTemplate().queryForList(sqlString.toString(), args, argTypes, Integer.class);
}
示例9: translate
import com.google.common.collect.ObjectArrays; //导入方法依赖的package包/类
/**
* Returns the fragment of text, which is matching the specified pattern,
* otherwise {@code null}.
*/
@Override
public String[] translate(String str) throws Exception {
Matcher matcher = super.pattern.matcher(str);
String[] fragments = new String[0];
while (matcher.find()) {
fragments = ObjectArrays.concat(fragments,
str.substring(matcher.start(), matcher.end()));
}
if (fragments.length > 0) {
return fragments;
} else {
return null;
}
}
示例10: concat
import com.google.common.collect.ObjectArrays; //导入方法依赖的package包/类
static @Nullable String[] concat(@Nullable String[] first, @Nullable String[] second) {
if (first == null)
return second;
if (second == null)
return first;
return ObjectArrays.concat(first, second, String.class);
}
示例11: getTouchTypes
import com.google.common.collect.ObjectArrays; //导入方法依赖的package包/类
private EventType<TouchHandler, TouchTypes>[] getTouchTypes() {
EventType<TouchHandler, TouchTypes>[] types = TouchEvent.getTypes(TouchTypes.TOUCH_START, TouchTypes.TOUCH_END, TouchTypes.TOUCH_CANCEL);
if (isDrawFollowTouch()) {
types = ObjectArrays.concat(types, TouchEvent.getType(TouchTypes.TOUCH_MOVE));
}
return types;
}
示例12: getAdjacentRegionBlock
import com.google.common.collect.ObjectArrays; //导入方法依赖的package包/类
private static Block getAdjacentRegionBlock(Region region, Block origin) {
for(BlockFace face : ObjectArrays.concat(CARDINAL_DIRECTIONS, DIAGONAL_DIRECTIONS, BlockFace.class)) {
Block adjacent = origin.getRelative(face);
if(region.contains(BlockUtils.center(adjacent).toVector())) {
return adjacent;
}
}
return null;
}
示例13: getBuffers
import com.google.common.collect.ObjectArrays; //导入方法依赖的package包/类
@Override
public DrillBuf[] getBuffers(boolean clear) {
final DrillBuf[] buffers = ObjectArrays.concat(offsets.getBuffers(false), vector.getBuffers(false), DrillBuf.class);
if (clear) {
for (DrillBuf buffer:buffers) {
buffer.retain();
}
clear();
}
return buffers;
}
示例14: newStrArray
import com.google.common.collect.ObjectArrays; //导入方法依赖的package包/类
/**
* Create a new string array with 'moreEntries' appended to the 'entries'
* array.
* @param entries initial entries in the array
* @param moreEntries variable-length additional entries.
* @return an array containing entries with all of moreEntries appended.
*/
protected String [] newStrArray(String [] entries, String... moreEntries) {
if (null == moreEntries) {
return entries;
}
if (null == entries) {
entries = new String[0];
}
return ObjectArrays.concat(entries, moreEntries, String.class);
}
示例15: beginSequence
import com.google.common.collect.ObjectArrays; //导入方法依赖的package包/类
private SendSequence beginSequence(Optional<SendInterceptor> sequenceInterceptor, int expectedResponses, Object... objects) {
if (requiresRset) {
if (ehloResponse.isSupported(Extension.PIPELINING)) {
return new SendSequence(sequenceInterceptor, expectedResponses + 1, ObjectArrays.concat(SmtpRequests.rset(), objects));
} else {
return new SendSequence(sequenceInterceptor, 1, SmtpRequests.rset()).thenSend(objects);
}
} else {
requiresRset = true;
return new SendSequence(sequenceInterceptor, expectedResponses, objects);
}
}