Example usage for org.apache.commons.lang3 ArrayUtils toPrimitive

List of usage examples for org.apache.commons.lang3 ArrayUtils toPrimitive

Introduction

In this page you can find the example usage for org.apache.commons.lang3 ArrayUtils toPrimitive.

Prototype

public static boolean[] toPrimitive(final Boolean[] array, final boolean valueForNull) 

Source Link

Document

Converts an array of object Booleans to primitives handling null .

This method returns null for a null input array.

Usage

From source file:com.l2jfree.gameserver.model.skills.conditions.ConditionPlayerClassIdRestriction.java

public ConditionPlayerClassIdRestriction(List<Integer> classId) {
    _classIds = ArrayUtils.toPrimitive(classId.toArray(new Integer[classId.size()]), 0);

    Arrays.sort(_classIds);//from ww w  .  jav  a 2s .c  o  m
}

From source file:com.l2jfree.gameserver.model.skills.conditions.ConditionTargetClassIdRestriction.java

public ConditionTargetClassIdRestriction(List<Integer> classId) {
    _classIds = ArrayUtils.toPrimitive(classId.toArray(new Integer[classId.size()]), 0);

    Arrays.sort(_classIds);/*  www.ja v a2  s  .c  o m*/
}

From source file:com.l2jfree.gameserver.model.skills.conditions.ConditionTargetRaceId.java

public ConditionTargetRaceId(List<Integer> raceId) {
    _raceIds = ArrayUtils.toPrimitive(raceId.toArray(new Integer[raceId.size()]), 0);

    Arrays.sort(_raceIds);
}

From source file:com.l2jfree.gameserver.model.skills.conditions.ConditionPlayerHasClanHall.java

public ConditionPlayerHasClanHall(List<Integer> clanHall) {
    _clanHall = ArrayUtils.toPrimitive(clanHall.toArray(new Integer[clanHall.size()]), 0);

    Arrays.sort(_clanHall);/*from  w w  w.  jav a2s .  co  m*/
}

From source file:com.l2jfree.gameserver.model.skills.conditions.ConditionPlayerInstanceId.java

public ConditionPlayerInstanceId(List<Integer> instanceIds) {
    _instanceIds = ArrayUtils.toPrimitive(instanceIds.toArray(new Integer[instanceIds.size()]), 0);

    Arrays.sort(_instanceIds);/*from   ww w .j  av a  2  s . c o m*/
}

From source file:org.jspresso.framework.application.frontend.action.lov.LovAction.java

/**
 * Handle preselected item.// w  w  w  .j a  v a2s  .  com
 *
 * @param preselection
 *     the preselected item or item collection.
 * @param queryComponent
 *     the query component.
 * @param lovView
 *     the lov view.
 */
protected void handlePreselectedItem(Object preselection, IQueryComponent queryComponent, IView<E> lovView) {

    if (preselection == null || queryComponent.getQueriedComponents().isEmpty()) {
        return;
    }

    ICollectionConnector resultConnector = (ICollectionConnector) ((ICompositeValueConnector) lovView
            .getConnector()).getChildConnector(IQueryComponent.QUERIED_COMPONENTS);
    if (resultConnector == null) {
        return;
    }

    Set<?> preselectionCollection;
    if (preselection instanceof Collection) {
        preselectionCollection = new HashSet<>((Collection<?>) preselection);
    } else {
        preselectionCollection = Collections.singleton(preselection);
    }
    List<Integer> indices = new ArrayList<>();
    for (int i = 0; i < queryComponent.getQueriedComponents().size(); i++) {
        if (preselectionCollection.contains(queryComponent.getQueriedComponents().get(i))) {
            indices.add(i);
        }
    }

    if (indices.isEmpty()) {
        return;
    }

    resultConnector.setSelectedIndices(ArrayUtils.toPrimitive(indices.toArray(new Integer[] {}), 0));
}

From source file:org.kalypsodeegree_impl.gml.binding.math.Polynomial1D.java

@Override
public double[] getCoefficients() {
    final List<Double> coefs = (List<Double>) getProperty(QNAME_PROP_COEFFICIENTS);
    if (coefs == null)
        return new double[0];

    final Double[] objects = coefs.toArray(new Double[coefs.size()]);
    return ArrayUtils.toPrimitive(objects, Double.NaN);
}

From source file:org.trustedanalytics.dataproviders.OnMqttMessageArrived.java

private float[] messageAsFloatArray(List<Float> message) {
    return ArrayUtils.toPrimitive(message.toArray(new Float[0]), 0.0F);
}