List of usage examples for org.apache.commons.lang ArrayUtils toObject
public static Boolean[] toObject(boolean[] array)
Converts an array of primitive booleans to objects.
From source file:com.github.rcaller.util.CodeUtils.java
public static void addDoubleArray(StringBuffer RCode, String name, double[] arr, boolean useEquals) { addArray(RCode, name, ArrayUtils.toObject(arr), useEquals, false); }
From source file:com.github.rcaller.util.RCodeUtils.java
public static void addLongArray(StringBuffer rCode, String name, long[] arr, boolean useEquals) { addArray(rCode, name, ArrayUtils.toObject(arr), useEquals, false); }
From source file:com.github.rcaller.util.RCodeUtils.java
public static void addFloatArray(StringBuffer rCode, String name, float[] arr, boolean useEquals) { addArray(rCode, name, ArrayUtils.toObject(arr), useEquals, false); }
From source file:com.github.rcaller.util.CodeUtils.java
public static void addShortArray(StringBuffer RCode, String name, short[] arr, boolean useEquals) { addArray(RCode, name, ArrayUtils.toObject(arr), useEquals, false); }
From source file:com.github.rcaller.util.RCodeUtils.java
public static void addDoubleArray(StringBuffer rCode, String name, double[] arr, boolean useEquals) { addArray(rCode, name, ArrayUtils.toObject(arr), useEquals, false); }
From source file:com.anjuke.romar.core.handlers.SimilarUserHandler.java
@Override public RomarResponse process(PreferenceRomarRequest request) throws Exception { int howMany = request.getLimit(); if (howMany <= 0) { howMany = DEFAULT_HOW_MANY;//from w ww . jav a 2 s . com } long[] ids = _service.mostSimilarUserIDs(request.getUserId(), howMany); return new MultiValueResponse(Arrays.asList(ArrayUtils.toObject(ids))); }
From source file:net.jforum.repository.ForumDao.java
public void moveTopics(Forum toForum, int... topicIds) { session.createQuery(/*from w w w . j a va2s .co m*/ "update Topic t set t.movedId = t.forum.id, t.forum = :newForum " + " where t.id in (:ids)") .setParameterList("ids", ArrayUtils.toObject(topicIds)).setParameter("newForum", toForum) .executeUpdate(); session.createQuery("update Post p set p.forum = :forum where p.topic.id in (:ids)") .setParameterList("ids", ArrayUtils.toObject(topicIds)).setParameter("forum", toForum) .executeUpdate(); }
From source file:com.github.rcaller.util.RCodeUtils.java
public static void addShortArray(StringBuffer rCode, String name, short[] arr, boolean useEquals) { addArray(rCode, name, ArrayUtils.toObject(arr), useEquals, false); }
From source file:com.mg.merp.report.support.RptMainServiceBean.java
@PermitAll public List<RptMain> loadAvailableReports(Integer classId) { StringBuilder sql = new StringBuilder("select rm from RptMain rm join rm.ClassLinks rcl where "); String[] names;/*from w ww . j a v a2 s . c om*/ Object[] values; Integer[] groups = ArrayUtils.toObject(ServerUtils.getUserProfile().getGroups()); if (classId != null) { sql.append("(rcl.SysClass.Id = :classId) and"); names = new String[] { "classId", "ids" }; values = new Object[] { classId, groups }; } else { names = new String[] { "ids" }; values = new Object[] { groups }; } sql.append(" exists (select rr from rm.Permissions rr where rr.SecGroups.Id in (:ids) and rr.Rights = 1) ") .append("order by rm.RptName, rm.Priority"); List<RptMain> result = MiscUtils.convertUncheckedList(RptMain.class, OrmTemplate.getInstance().findByNamedParam(sql.toString(), names, values)); return result; }
From source file:au.org.ala.delta.key.TreatCharactersAsVariableTest.java
@Test public void testTreatCharactersAsVariable() throws Exception { URL directivesFileURL = getClass().getResource("/sample/testTreatCharactersAsVariableInputFile"); File directivesFile = new File(directivesFileURL.toURI()); KeyContext context = new KeyContext(directivesFile); context.setMaximumNumberOfItems(100); context.setNumberOfCharacters(100);//from ww w . j a v a 2s . c o m KeyDirectiveParser parser = KeyDirectiveParser.createInstance(); parser.parse(directivesFile, context); assertEquals(new HashSet<Integer>(Arrays.asList(ArrayUtils.toObject(new int[] { 44, 66 }))), context.getVariableCharactersForTaxon(1)); assertEquals(new HashSet<Integer>(Arrays.asList(ArrayUtils.toObject(new int[] { 4, 5, 6, 7, 8, 9, 10 }))), context.getVariableCharactersForTaxon(4)); KeyUtils.loadDataset(context); assertTrue(isVariable((MultiStateAttribute) context.getDataSet().getAttribute(1, 44))); assertTrue(isVariable((MultiStateAttribute) context.getDataSet().getAttribute(1, 66))); assertTrue(isVariable((MultiStateAttribute) context.getDataSet().getAttribute(4, 4))); assertTrue(isVariable((MultiStateAttribute) context.getDataSet().getAttribute(4, 5))); assertTrue(isVariable((MultiStateAttribute) context.getDataSet().getAttribute(4, 6))); assertTrue(isVariable((MultiStateAttribute) context.getDataSet().getAttribute(4, 7))); assertTrue(isVariable((MultiStateAttribute) context.getDataSet().getAttribute(4, 8))); assertTrue(isVariable((MultiStateAttribute) context.getDataSet().getAttribute(4, 9))); assertTrue(isVariable((MultiStateAttribute) context.getDataSet().getAttribute(4, 10))); }