@JsonIgnore public DataSegment getSegment(SegmentId segmentId) { return idToSegments.get(segmentId); }
/** * Gets the directory entry for the root with the given name or {@code null} if no such root * exists. */ @Nullable public DirectoryEntry getRoot(Name name) { Directory dir = roots.get(name); return dir == null ? null : dir.entryInParent(); }
/** * Returns the {@link Value} for the given property {@code name}. * * @throws DatastoreException if no such property */ public <V extends Value<?>> V getValue(String name) { @SuppressWarnings("unchecked") V property = (V) properties.get(name); if (property == null) { throw DatastoreException.throwInvalidRequest("No such property %s", name); } return property; }
List<String> dimensions = whiteListDimsMapper.get(prefixKey); if (dimensions == null) { return Collections.emptyList();
Set<String> dimensions = whiteListDimsMapper.get(prefixKey); if (dimensions == null) { return Collections.emptyList();
public void testNullGet() { ImmutableSortedMap<String, Integer> map = ImmutableSortedMap.of("one", 1); assertNull(map.get(null)); }
private RexNode decorrFieldAccess(RexFieldAccess fieldAccess) { int newInputOutputOffset = 0; for (RelNode input : currentRel.getInputs()) { final Frame frame = map.get(input); if (frame != null) { // try to find in this input rel the position of cor var final CorRef corRef = cm.mapFieldAccessToCorRef.get(fieldAccess); if (corRef != null) { Integer newInputPos = frame.corDefOutputs.get(corRef.def()); if (newInputPos != null) { // This input rel does produce the cor var referenced. // Assume fieldAccess has the correct type info. return new RexInputRef(newInputPos + newInputOutputOffset, frame.r.getRowType().getFieldList().get(newInputPos) .getType()); } } // this input rel does not produce the cor var needed newInputOutputOffset += frame.r.getRowType().getFieldCount(); } else { // this input rel is not rewritten newInputOutputOffset += input.getRowType().getFieldCount(); } } return fieldAccess; } }
rightFrame.oldToNewOutputs.get(i) + newLeftFieldCount);
rightFrame.oldToNewOutputs.get(i) + newLeftFieldCount);
newLocalOrdinal = frame.oldToNewOutputs.get(oldLocalOrdinal);
String value = tags.get(name); Tag.factory.findOrCreate(name, value); MetricTag.factory.findOrCreate(key, name, value);
@Nullable public Long getProjectIdByKeyIgnoreCase(final String projectKey) { return projectsByKeyIgnoreCase.get(projectKey); }
@JsonIgnore public DataSegment getSegment(String segmentIdentifier) { return idToSegments.get(segmentIdentifier); }
@Override public boolean contains(Object target) { if (target instanceof Entry) { Entry<?, ?> entry = (Entry<?, ?>) target; V mappedValue = map.get(entry.getKey()); return mappedValue != null && mappedValue.equals(entry.getValue()); } return false; }
/** * Gets the amount at the specified index. * * @param index the zero-based index to retrieve * @return the amount at the specified index */ public MultiCurrencyAmount get(int index) { List<CurrencyAmount> currencyAmounts = values.keySet().stream() .map(ccy -> CurrencyAmount.of(ccy, values.get(ccy).get(index))) .collect(toList()); return MultiCurrencyAmount.of(currencyAmounts); }
public void test_toMap() { ImmutableSortedMap<Currency, Double> test = MultiCurrencyAmount.of(CA1, CA2).toMap(); assertEquals(test.size(), 2); assertEquals(test.containsKey(CA1.getCurrency()), true); assertEquals(test.containsKey(CA2.getCurrency()), true); assertEquals(test.get(CA1.getCurrency()), Double.valueOf(CA1.getAmount())); assertEquals(test.get(CA2.getCurrency()), Double.valueOf(CA2.getAmount())); }