List of usage examples for com.google.common.collect ObjectArrays concat
public static <T> T[] concat(T[] array, @Nullable T element)
From source file:com.isotrol.impe3.web.ImpeContextLoaderListener.java
@Override protected ContextLoader createContextLoader() { return new ContextLoader() { @Override/* w w w. j av a2s . com*/ protected void customizeContext(ServletContext servletContext, ConfigurableWebApplicationContext applicationContext) { String[] locations = applicationContext.getConfigLocations(); locations = ObjectArrays.concat(locations, AppContext.RES_PATH); applicationContext.setConfigLocations(locations); } }; }
From source file:com.isotrol.impe3.users.web.Impe3UsersContextLoaderListener.java
@Override protected ContextLoader createContextLoader() { return new ContextLoader() { @Override// w w w . j av a 2s. co m protected void customizeContext(ServletContext servletContext, ConfigurableWebApplicationContext applicationContext) { String[] locations = applicationContext.getConfigLocations(); locations = ObjectArrays.concat(locations, RES_PATH); applicationContext.setConfigLocations(locations); } }; }
From source file:com.google.caliper.maven.CaliperBenchmarkHarness.java
public void run(String[] args) throws InvalidConfigurationException, InvalidCommandException, InvalidBenchmarkException { PrintWriter stdout = new PrintWriter(System.out, true); PrintWriter stderr = new PrintWriter(System.err, true); CaliperMain.exitlessMain(ObjectArrays.concat(args, benchmarkClass.getName()), stdout, stderr); }
From source file:org.sonatype.nexus.NexusAppTestSupport.java
@Override protected Module[] getTestCustomModules() { final Module[] modules = super.getTestCustomModules(); return ObjectArrays.concat(modules, new Module() { @Override/* w w w.j a va 2 s .c o m*/ public void configure(final Binder binder) { binder.bind(Config.class).toInstance(new ConfigImpl(enableAutomaticRoutingFeature())); } }); }
From source file:eu.lp0.cursus.db.dao.RaceDAO.java
@Override protected Predicate[] withParentRestriction(CriteriaBuilder cb, Root<Race> r, Race race, Predicate... predicates) { return ObjectArrays.concat(predicates, cb.equal(r.get("event"), race.getEvent())); //$NON-NLS-1$ }
From source file:org.sonatype.security.ldap.LdapTestSupport.java
@Override protected Module[] getTestCustomModules() { Module[] modules = super.getTestCustomModules(); if (modules == null) { modules = new Module[0]; }//w w w. jav a 2 s .c o m modules = ObjectArrays.concat(modules, new SecurityModule()); return modules; }
From source file:eu.lp0.cursus.db.dao.EventDAO.java
@Override protected Predicate[] withParentRestriction(CriteriaBuilder cb, Root<Event> e, Event event, Predicate... predicates) { return ObjectArrays.concat(predicates, cb.equal(e.get("series"), event.getSeries())); //$NON-NLS-1$ }
From source file:org.shaf.core.event.EventListenerHandler.java
/** * Adds a new {@link EventListener}s to this handler. * //from w w w . j a va 2s . c om * @param listeners * the listeners to add. */ public void addEventListeners(final EventListener... listeners) { if (listeners != null) { for (EventListener listener : listeners) { if (this.listeners == null) { this.listeners = new EventListener[] { listener }; } else { this.listeners = ObjectArrays.concat(this.listeners, listener); } } } }
From source file:org.shaf.core.process.type.comp.LinearProcess.java
/** * Adds a new process to the chain./*from w w w.j a v a2s . c om*/ * * @param pcls * the process class to add. * @param args * the process command-line arguments. */ protected final void addProcess(final Class<? extends Process> pcls, final String args) { if (this.chain == null) { chain = new Class<?>[] { pcls }; } else { chain = ObjectArrays.concat(chain, pcls); } if (this.arguments == null) { arguments = new String[] { args }; } else { arguments = ObjectArrays.concat(arguments, args); } }
From source file:co.cask.cdap.gateway.GatewayFastTestsSuite.java
public static HttpResponse doGet(String resource, Header[] headers) throws Exception { DefaultHttpClient client = new DefaultHttpClient(); HttpGet get = new HttpGet(GatewayTestBase.getEndPoint(resource)); if (headers != null) { get.setHeaders(ObjectArrays.concat(AUTH_HEADER, headers)); } else {//ww w .j av a 2 s. c om get.setHeader(AUTH_HEADER); } return client.execute(get); }