當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。