Example usage for org.apache.commons.collections4 MapUtils getIntValue

List of usage examples for org.apache.commons.collections4 MapUtils getIntValue

Introduction

In this page you can find the example usage for org.apache.commons.collections4 MapUtils getIntValue.

Prototype

public static <K> int getIntValue(final Map<? super K, ?> map, final K key, final int defaultValue) 

Source Link

Document

Gets an int from a Map in a null-safe manner, using the default value if the the conversion fails.

Usage

From source file:com.crosstreelabs.jaxrs.api.versioned.fixtures.vo.UserV2.java

@Override
public ValueObject consume(final Map data) {
    name = MapUtils.getString(data, "name");
    username = MapUtils.getString(data, "username");
    email = MapUtils.getString(data, "email");
    age = MapUtils.getIntValue(data, "age", 0);
    return this;
}