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:org.uncertml.statistic.Probability.java
/** * Constructor that takes a single probability constraint and an array of doubles as values. * Each double represents a single probability statistic. This is in line with * the UncertML syntax whereby a collection of types can be represented by a * single entity./*from w w w .j av a 2 s .com*/ * * @param constraint the constraint that each probability statistic represented * by this object must satisfy. * @param values an array of doubles representing the value of n probability * statistics. */ public Probability(ProbabilityConstraint constraint, double[] values) { this(constraint, Arrays.asList(ArrayUtils.toObject(values))); }
From source file:org.uncertml.statistic.Quantile.java
/** * Constructs a quantile from a specified level and an array of doubles. * Each double represents a single quantile statistic. This is in line with the * UncertML syntax whereby a collection of types can be represented by a single entity. * //from ww w .jav a 2s.c o m * @param level a double value representing the level of each quantile represented by * this object. Must be in the range 0 - 1. * @param values an array of doubles representing the value of n * quantile statistics - each with the same level. */ public Quantile(double level, double[] values) { this(level, Arrays.asList(ArrayUtils.toObject(values))); }
From source file:org.uncertml.statistic.Quartile.java
/** * Constructs a quartile from a specified level and an array of doubles. * Each double represents a single quartile statistic. This is in line with the * UncertML syntax whereby a collection of types can be represented by a single entity. * /*from w w w.j av a2s. c o m*/ * @param level a double value representing the level of each quartile. Must * be either 0.25 or 0.75. * @param values an array of doubles representing the value of n * quartile statistics - each with the same level. */ public Quartile(double level, double[] values) { this(level, Arrays.asList(ArrayUtils.toObject(values))); }
From source file:org.uncertml.statistic.Range.java
/** * Constructor that takes an array of doubles for lower and upper bounds. Each * lower and upper pair represents a single range statistic. This is in line * with the UncertML syntax whereby a collection of types can be represented * by a single entity. The arrays must be of equal length. * /*from w ww. j ava2 s.c o m*/ * @param lower the lower bound of n range statistics. * @param upper the upper bound of n range statistics. */ public Range(double[] lower, double[] upper) { this(Arrays.asList(ArrayUtils.toObject(lower)), Arrays.asList(ArrayUtils.toObject(upper))); }
From source file:org.uncertml.statistic.StandardDeviation.java
/** * Constructor that takes an array of doubles. Each value represents * a single standard deviation statistic. This is in line with the UncertML syntax * whereby a collection of types can be represented by a single entity. * // www . j a v a2s .co m * @param values an array of doubles representing the value of n * standard deviation statistics. */ public StandardDeviation(double[] values) { this(Arrays.asList(ArrayUtils.toObject(values))); }
From source file:org.uncertml.statistic.Variance.java
/** * Constructor that takes an array of doubles. Each value represents * a single variance statistic. This is in line with the UncertML syntax * whereby a collection of types can be represented by a single entity. * //ww w. java 2 s . c o m * @param values an array of doubles representing the value of n * variance statistics. */ public Variance(double[] values) { this(Arrays.asList(ArrayUtils.toObject(values))); }
From source file:org.unitils.core.util.CollectionUtils.java
/** * Converts the given array object (possibly primitive array) to type Object[] * * @param object The array/* w w w . j a va 2 s . c o m*/ * @return The object array */ public static Object[] convertToObjectArray(Object object) { if (object == null) { return null; } if (object instanceof byte[]) { return ArrayUtils.toObject((byte[]) object); } if (object instanceof short[]) { return ArrayUtils.toObject((short[]) object); } if (object instanceof int[]) { return ArrayUtils.toObject((int[]) object); } if (object instanceof long[]) { return ArrayUtils.toObject((long[]) object); } if (object instanceof char[]) { return ArrayUtils.toObject((char[]) object); } if (object instanceof float[]) { return ArrayUtils.toObject((float[]) object); } if (object instanceof double[]) { return ArrayUtils.toObject((double[]) object); } if (object instanceof boolean[]) { return ArrayUtils.toObject((boolean[]) object); } return (Object[]) object; }
From source file:org.unitils.util.CollectionUtils.java
/** * Converts the given array object (possibly primitive array) to type Object[] * * @param object The array/*from w w w.ja v a 2s .c o m*/ * @return The object array */ public static Object[] convertToObjectArray(Object object) { if (object instanceof byte[]) { return ArrayUtils.toObject((byte[]) object); } else if (object instanceof short[]) { return ArrayUtils.toObject((short[]) object); } else if (object instanceof int[]) { return ArrayUtils.toObject((int[]) object); } else if (object instanceof long[]) { return ArrayUtils.toObject((long[]) object); } else if (object instanceof char[]) { return ArrayUtils.toObject((char[]) object); } else if (object instanceof float[]) { return ArrayUtils.toObject((float[]) object); } else if (object instanceof double[]) { return ArrayUtils.toObject((double[]) object); } else if (object instanceof boolean[]) { return ArrayUtils.toObject((boolean[]) object); } else { return (Object[]) object; } }
From source file:org.wso2.andes.server.information.management.QueueManagementInformationMBean.java
/*** * {@inheritDoc}/*from w ww. ja v a2 s. com*/ */ @Override public void restoreSelectedMessagesFromDeadLetterChannel( @MBeanOperationParameter(name = "andesMessageIds", description = "IDs of the Messages to Be restored") long[] andesMessageIds, @MBeanOperationParameter(name = "destinationQueueName", description = "Original destination queue of the messages") String destinationQueueName) throws MBeanException { if (null != andesMessageIds) { int movedMessageCount = -1; List<Long> andesMessageIdList = new ArrayList<>(andesMessageIds.length); Collections.addAll(andesMessageIdList, ArrayUtils.toObject(andesMessageIds)); try { movedMessageCount = moveMessagesFromDLCToNewDestination(andesMessageIdList, destinationQueueName, destinationQueueName, true); } catch (AndesException ex) { throw new MBeanException(ex, "Error occurred when restoring messages from DLC to original qeueue : " + destinationQueueName + " movedMessageCount : " + movedMessageCount); } } }
From source file:org.wso2.andes.server.information.management.QueueManagementInformationMBean.java
/*** * {@inheritDoc}//from w ww . j a v a 2 s . co m */ @Override public void rerouteSelectedMessagesFromDeadLetterChannel( @MBeanOperationParameter(name = "andesMessageIds", description = "IDs of the Messages to Be Restored") long[] andesMessageIds, @MBeanOperationParameter(name = "sourceQueue", description = "The original queue name of the messages") String sourceQueue, @MBeanOperationParameter(name = "targetQueue", description = "New destination queue for the messages") String targetQueue) throws MBeanException { if (null != andesMessageIds) { int movedMessageCount = -1; List<Long> andesMessageIdList = new ArrayList<>(andesMessageIds.length); Collections.addAll(andesMessageIdList, ArrayUtils.toObject(andesMessageIds)); try { movedMessageCount = moveMessagesFromDLCToNewDestination(andesMessageIdList, sourceQueue, targetQueue, false); } catch (AndesException ex) { throw new MBeanException(ex, "Error occurred when moving messages destined to sourceQueue : " + sourceQueue + " from DLC to targetQueue : " + targetQueue + ". movedMessageCount : " + movedMessageCount); } } }