@Override public Set<Entry<K, V>> entrySet() { return transformSet(keySet(), new EntryTransformer()); }
public Map<String, Object> getContextParams() { final Map<String, Object> newParams = MapBuilder.<String, Object> newBuilder(). add("project", project). add("request", request). toMutableMap(); return CompositeMap.of(newParams, params); }
/** * Make a composite caching map of the local and master maps. * * @param localValues any values that may override elements in the Master. * @return a map instance that will be lazily populated with the values from the master. */ public Map<K, V> toMap(final Map<K, ? extends V> localValues) { @SuppressWarnings("unchecked") final Map<K, V> map = (Map<K, V>) localValues; return CompositeMap.of(map, new MemoizingMap<K, V>(suppliers)); }
@Override public Map<String, Object> appendToParamsMap(final Map<String, Object> input) { return MapBuilder.newBuilder(input) .add(FIELD_PROJECT, null) .toMap(); // props.put(FIELD_ISSUE_TYPE, null); }
/** * Make a composite {@link Master} of the other and this master. * * @param other any values that may override elements in this Master. * @return a map instance that will be lazily populated with the values from the master. */ public Master<K, V> combine(final Master<K, V> other) { return new Master<K, V>(CompositeMap.of(other.suppliers, suppliers)); }
public static <K, V> MultiMap<K, V, Set<V>> createSetMultiMap() { return create(new SetSupplier<V>()); }
public static <K, V> MultiMap<K, V, List<V>> createListMultiMap() { return create(new ListSupplier<V>()); }
public boolean isEmpty() { return results.isEmpty(); } }
public int size() { return delegate.size(); } }
public void foreach(final Consumer<Issue> sink) { CollectionUtil.foreach(new AbstractTransformIssueIterator<Long>(ids) { @Override protected Issue transform(final Long o) { return issueManager.getIssueObject(o); } }, sink); }
@Override public Set<Entry<K, V>> entrySet() { final EntrySet entries = entrySet; return (entries != null) ? entries : (entrySet = new EntrySet()); }
@Override protected final boolean removeEldestEntry(final Map.Entry<K, V> eldest) { return size() > maxSize; } }
/** * Create an {@link EnclosedIterable} from the supplied Collection. Does not copy the collection * so you should only use this if you are about to lose the reference or the collection is immutable. * @param <T> the collection type * @param collection * @return */ public static <T> EnclosedIterable<T> from(final Collection<? extends T> collection) { return new CollectionEnclosedIterable<T>(collection); }
/** * Static factory method for creating a fresh {@link MapBuilder}. * * @param <K> the key type * @param <V> the value type * @return a new empty {@link MapBuilder} */ public static <K, V> MapBuilder<K, V> newBuilder() { return new MapBuilder<K, V>(); }
public static <K, V> MultiMap<K, V, List<V>> unmodifiableListMultiMap(final MultiMap<K, V, List<V>> multiMap) { return new UnmodifiableMultiMap<K, V, List<V>>(multiMap, new Function<List<V>, List<V>>() { public List<V> get(final List<V> input) { return unmodifiableList(input); } }); }
@Override public int getPageSize() { return delegate.getPageSize(); } }
/** * An unmodifiable {@link List} view of the underlying data that does not change. * * @return a {@link List} containing all the elements as at the time the call was made. */ public List<T> asList() { return new SetBackedList<T>(set); }
public static <T> IdentityReference<T> wrap(final T value) { return new IdentityReference<T>(value); } }