当前位置: 首页>>代码示例>>Java>>正文


Java ObjectArrays.concat方法代码示例

本文整理汇总了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;
}
 
开发者ID:dryganets,项目名称:vogar,代码行数:23,代码来源:CaliperRunner.java

示例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;
}
 
开发者ID:zugzug90,项目名称:guava-mock,代码行数:20,代码来源:SimpleTimeLimiter.java

示例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;
}
 
开发者ID:antlr,项目名称:codebuff,代码行数:19,代码来源:SimpleTimeLimiter.java

示例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;
}
 
开发者ID:major2015,项目名称:easyrec_major,代码行数:23,代码来源:LatestActionDAOMysqlImpl.java

示例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));
}
 
开发者ID:edgehosting,项目名称:jira-dvcs-connector,代码行数:19,代码来源:RepositoryPullRequestDaoImpl.java

示例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;
}
 
开发者ID:Cooperate-Project,项目名称:CooperateModelingEnvironment,代码行数:20,代码来源:NatureUtils.java

示例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;
}
 
开发者ID:cplutte,项目名称:bts,代码行数:21,代码来源:SimpleTimeLimiter.java

示例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);
}
 
开发者ID:ferronrsmith,项目名称:easyrec,代码行数:24,代码来源:ProfiledItemTypeDAOMysqlImpl.java

示例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;
	}
}
 
开发者ID:SHAF-WORK,项目名称:shaf,代码行数:21,代码来源:ExtractFragFunction.java

示例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);
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:8,代码来源:Proto.java

示例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;
}
 
开发者ID:YoungDigitalPlanet,项目名称:empiria.player,代码行数:8,代码来源:ConnectionViewVertical.java

示例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;
}
 
开发者ID:OvercastNetwork,项目名称:ProjectAres,代码行数:10,代码来源:LaneMatchModule.java

示例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;
}
 
开发者ID:skhalifa,项目名称:QDrill,代码行数:12,代码来源:BaseRepeatedValueVector.java

示例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);
}
 
开发者ID:aliyun,项目名称:aliyun-maxcompute-data-collectors,代码行数:19,代码来源:BaseSqoopTestCase.java

示例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);
  }
}
 
开发者ID:HubSpot,项目名称:NioSmtpClient,代码行数:13,代码来源:SmtpSession.java


注:本文中的com.google.common.collect.ObjectArrays.concat方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。