Example usage for com.google.common.collect BiMap getOrDefault

List of usage examples for com.google.common.collect BiMap getOrDefault

Introduction

In this page you can find the example usage for com.google.common.collect BiMap getOrDefault.

Prototype

default V getOrDefault(Object key, V defaultValue) 

Source Link

Document

Returns the value to which the specified key is mapped, or defaultValue if this map contains no mapping for the key.

Usage

From source file:org.opencb.opencga.storage.hadoop.variant.metadata.HBaseStudyConfigurationManager.java

private void updateStudiesSummary(String study, Integer studyId, QueryOptions options) {
    BiMap<String, Integer> studiesSummary = getStudies(options);
    if (study.isEmpty()) {
        throw new IllegalStateException("Can't save an study with empty StudyName");
    }/* ww  w  .ja va2  s  .  co m*/
    if (studiesSummary.getOrDefault(study, Integer.MIN_VALUE).equals(studyId)) {
        //Nothing to update
        return;
    } else {
        studiesSummary.put(study, studyId);
        updateStudiesSummary(studiesSummary, options);
    }
}