Example usage for com.google.common.collect ObjectArrays concat

List of usage examples for com.google.common.collect ObjectArrays concat

Introduction

In this page you can find the example usage for com.google.common.collect ObjectArrays concat.

Prototype

public static <T> T[] concat(T[] array, @Nullable T element) 

Source Link

Document

Returns a new array that appends element to array .

Usage

From source file:org.apache.crunch.io.hbase.HBaseSourceTarget.java

public HBaseSourceTarget(String table, Scan scan, Scan... additionalScans) {
    this(table, ObjectArrays.concat(scan, additionalScans));
}

From source file:org.marketcetera.photon.views.OptionOrderTicketModel.java

/**
 * Get the valid values for the order capacity.
 * /*w w  w . ja  va2 s. c om*/
 * @return the valid order capacity values
 */
public Object[] getValidOrderCapacityValues() {
    return ObjectArrays.concat(BLANK, EnumSet
            .of(OrderCapacity.Agency, OrderCapacity.Principal, OrderCapacity.RisklessPrincipal).toArray());
}

From source file:org.apache.crunch.io.hbase.HBaseSourceTarget.java

public HBaseSourceTarget(TableName table, Scan scan, Scan... additionalScans) {
    this(table, ObjectArrays.concat(scan, additionalScans));
}

From source file:org.netbeans.modules.android.project.AndroidActionProvider.java

@Override
public String[] getSupportedActions() {
    return project.info().isTest() ? ObjectArrays.concat(supportedActions, COMMAND_TEST) : supportedActions;
}

From source file:google.registry.tools.CommandTestCase.java

/** Adds "--force" as the first parameter, then runs the command. */
protected void runCommandForced(String... args) throws Exception {
    runCommand(ObjectArrays.concat("--force", args));
}

From source file:org.marketcetera.photon.views.OptionOrderTicketModel.java

/**
 * Get the valid values for the position effect.
 * //from  w ww.j  av a 2  s.c  o m
 * @return the valid position effect values
 */
public Object[] getValidPositionEffectValues() {
    return ObjectArrays.concat(BLANK, EnumSet.complementOf(EnumSet.of(PositionEffect.Unknown)).toArray());
}

From source file:org.trustedanalytics.user.manageusers.CfUsersService.java

@Override
public Optional<User> addOrgUser(UserRequest userRequest, UUID orgGuid, String currentUser) {
    Optional<UserIdNamePair> idNamePair = uaaClient.findUserIdByName(userRequest.getUsername());
    if (!idNamePair.isPresent()) {
        inviteUserToOrg(userRequest.getUsername(), currentUser, orgGuid,
                ImmutableSet.<Role>builder().addAll(userRequest.getRoles()).add(Role.USERS).build());
    }//from   w  w w  .j  a  v a  2  s  . c o  m

    return idNamePair.map(pair -> {
        UUID userGuid = pair.getGuid();
        Role[] roles = ObjectArrays.concat(userRequest.getRoles().toArray(new Role[] {}), Role.USERS);
        assignOrgRolesToUser(userGuid, orgGuid, roles);
        return new User(userRequest.getUsername(), userGuid, userRequest.getRoles(), orgGuid);
    });
}

From source file:org.shaf.core.process.handle.job.JobConfigurator.java

/**
 * Appends a new job configuration action.
 * //from www  .j a v a 2  s. com
 * @param action
 *            the job configuration action to append.
 */
private final void appendAction(final Class<?> action) {
    this.actions = ObjectArrays.concat(this.actions, action);
}

From source file:org.shaf.client.net.ClientController.java

/**
 * Constructs a new client controller./*  w ww .  jav  a2s .  c  o m*/
 * 
 * @param base
 *            the server base URL.
 * @param username
 *            the user name.
 * @param password
 *            the password.
 * @throws NetworkException
 *             if failed to create the client controller.
 */
private ClientController(final String base, final String username, final String password)
        throws NetworkException {
    this.conn = NetworkFactory.getConnection(base, username, password);

    Role[] roles = new Role[0];
    for (Role role : Role.values()) {
        if (this.hasRole(role.getName())) {
            roles = ObjectArrays.concat(roles, role);
        }
    }
    this.firewall = new Firewall(roles);
}

From source file:org.jboss.pnc.rest.provider.AbstractProvider.java

public CollectionInfo<RESTEntity> queryForCollection(int pageIndex, int pageSize, String sortingRsql,
        String query, Predicate<DBEntity>... predicates) {
    Predicate<DBEntity> rsqlPredicate = rsqlPredicateProducer.getPredicate(getDBEntityClass(), query);
    PageInfo pageInfo = pageInfoProducer.getPageInfo(pageIndex, pageSize);
    SortInfo sortInfo = sortInfoProducer.getSortInfo(sortingRsql);

    List<DBEntity> collection;
    int totalPages;
    if (predicates == null) {
        collection = repository.queryWithPredicates(pageInfo, sortInfo, rsqlPredicate);
        totalPages = (repository.count(rsqlPredicate) + pageSize - 1) / pageSize;
    } else {/*from   w ww. j  a v a  2  s  .  c  o m*/
        collection = repository.queryWithPredicates(pageInfo, sortInfo,
                ObjectArrays.concat(rsqlPredicate, predicates));
        totalPages = (repository.count(ObjectArrays.concat(rsqlPredicate, predicates)) + pageSize - 1)
                / pageSize;
    }

    return nullableStreamOf(collection).map(toRESTModel())
            .collect(new CollectionInfoCollector<>(pageIndex, pageSize, totalPages));
}