Example usage for org.apache.commons.collections MapUtils getObject

List of usage examples for org.apache.commons.collections MapUtils getObject

Introduction

In this page you can find the example usage for org.apache.commons.collections MapUtils getObject.

Prototype

public static Object getObject(final Map map, final Object key) 

Source Link

Document

Gets from a Map in a null-safe manner.

Usage

From source file:com.streamreduce.core.model.Metric.java

@SuppressWarnings("unchecked")
public Metric(Map<String, Object> map) {
    if (map != null) {
        setId((ObjectId) MapUtils.getObject(map, "_id"));
        setAccountId(MapUtils.getString(map, "accountId"));
        setTs(MapUtils.getLong(map, "metricTimestamp"));
        setValue(MapUtils.getLong(map, "metricValue"));
        setGranularity(MapUtils.getLong(map, "metricGranularity"));
        setAgv(MapUtils.getLong(map, "metricAVGY"));
        setAgv(MapUtils.getLong(map, "metricAVGY"));
        setStddev(MapUtils.getLong(map, "metricAVGY"));
        setDiff(MapUtils.getLong(map, "metricAVGY"));
        setMin(MapUtils.getLong(map, "metricAVGY"));
        setMax(MapUtils.getLong(map, "metricAVGY"));
        setAnomaly(MapUtils.getBoolean(map, "metricIsAnomaly"));

        Map<String, String> criteria = (Map<String, String>) map.get("metricCriteria");
        setCriteria(criteria);// w  ww  .j  av  a2  s  .  c om
    }
}

From source file:com.newlandframework.avatarmq.consumer.ConsumerClusters.java

public RemoteChannelData findRemoteChannelData(String clientId) {
    return (RemoteChannelData) MapUtils.getObject(channelMap, clientId);
}

From source file:org.kuali.rice.krad.maintenance.MaintainableImpl.java

/**
 * Returns whether a line that contains a field is restricted; that is, if the field is part of a group and that
 * group has some unauthorized binding information.
 *
 * @param field field being checked for restrictions
 *
 * @return true if the field is in a line with restrictions, false otherwise
 *//*from w  ww  .j a  va  2  s .c  om*/
private boolean isLineRestricted(DataField field) {
    CollectionGroup group = (CollectionGroup) MapUtils.getObject(field.getContext(),
            UifConstants.ContextVariableNames.COLLECTION_GROUP);

    return group != null && CollectionUtils.isNotEmpty(group.getUnauthorizedLineBindingInfos());
}

From source file:org.springmodules.validation.valang.functions.BeanPropertyFunction.java

private Object getValue(Map map, String[] path) {
    if (path.length > 0) {
        Object result = MapUtils.getObject(map, path[0]);
        if (path.length > 1) {
            return new BeanPropertyFunction(concat(pop(path))).getResult(result);
        } else {/*from w w w.  j  a va2  s .  c  o m*/
            return result;
        }
    }

    return null;
}