use of org.eclipse.collections.impl.map.mutable.UnifiedMap in project eclipse-collections by eclipse.
the class ImmutableUnifiedMapTest method newWith.
@Override
public final <T> ImmutableMap<Object, T> newWith(T... elements) {
Random random = new Random(CURRENT_TIME_MILLIS);
MutableMap<Object, T> result = new UnifiedMap<>();
for (T each : elements) {
assertNull(result.put(random.nextDouble(), each));
}
return result.toImmutable();
}
use of org.eclipse.collections.impl.map.mutable.UnifiedMap in project eclipse-collections by eclipse.
the class SynchronizedMutableMapTest method newWith.
@Override
public <T> MutableMap<Object, T> newWith(T... elements) {
Random random = new Random(CURRENT_TIME_MILLIS);
MutableMap<Object, T> result = new UnifiedMap<>();
for (T each : elements) {
assertNull(result.put(random.nextDouble(), each));
}
return SynchronizedMutableMap.of(result);
}
use of org.eclipse.collections.impl.map.mutable.UnifiedMap in project eclipse-collections by eclipse.
the class UnmodifiableMutableMapTest method newWith.
@Override
public <T> MutableMap<Object, T> newWith(T... elements) {
Random random = new Random(CURRENT_TIME_MILLIS);
MutableMap<Object, T> result = new UnifiedMap<>();
for (T each : elements) {
assertNull(result.put(random.nextDouble(), each));
}
return UnmodifiableMutableMap.of(result);
}
use of org.eclipse.collections.impl.map.mutable.UnifiedMap in project eclipse-collections by eclipse.
the class UnifiedMapKeySetTest method newWith.
@SafeVarargs
@Override
public final <T> Set<T> newWith(T... elements) {
Random random = new Random(CURRENT_TIME_MILLIS);
MutableMap<T, Double> result = new UnifiedMap<>();
for (T element : elements) {
assertNull(result.put(element, random.nextDouble()));
}
return result.keySet();
}
use of org.eclipse.collections.impl.map.mutable.UnifiedMap in project robozonky by RoboZonky.
the class AbstractEmailingListener method getData.
protected Map<String, Object> getData(final T event) {
final Map<String, Object> result = new UnifiedMap<>(getBaseData(event));
if (event instanceof Financial) {
final PortfolioOverview portfolioOverview = ((Financial) event).getPortfolioOverview();
result.put("portfolio", Util.summarizePortfolioStructure(portfolioOverview));
}
return result;
}
Aggregations