T - field typepublic final class FieldMapImpl<T> extends AbstractField<T>
ImmutableMap.| Modifier and Type | Class and Description |
|---|---|
static class |
FieldMapImpl.Builder<T>
Builder for an immutable field.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
containsKey(DeviceUID id)
Verifies if some device has an entry in this field.
|
T |
get(DeviceUID id) |
java.util.Optional<T> |
getIfPresent(DeviceUID device) |
DeviceUID |
getLocalDevice() |
T |
getLocalValue() |
com.google.common.collect.ImmutableSet<? extends java.util.Map.Entry<DeviceUID,T>> |
iterable() |
com.google.common.collect.ImmutableSet<DeviceUID> |
keys() |
java.util.stream.Stream<DeviceUID> |
keyStream() |
int |
size()
The number of neighbors in this field.
|
java.util.stream.Stream<? extends java.util.Map.Entry<DeviceUID,T>> |
stream() |
com.google.common.collect.ImmutableMap<DeviceUID,T> |
toMap() |
com.google.common.collect.ImmutableCollection<T> |
values() |
java.util.stream.Stream<T> |
valueStream() |
equals, hashCode, toStringclone, finalize, getClass, notify, notifyAll, wait, wait, waitfoldExcludingLocal, foldExcludingLocal, foldIncludingLocal, foldIncludingLocal, foldKeysExcludingLocal, foldKeysIncludingLocal, foldValuesExcludingLocal, foldValuesIncludingLocal, getExpectedType, getLocal, isEmpty, map, projectOn, reduce, reduce, reduceKeys, reduceValuespublic boolean containsKey(DeviceUID id)
Fieldid - a device UIDpublic DeviceUID getLocalDevice()
public T get(@Nonnull DeviceUID id)
id - the DeviceUIDpublic java.util.Optional<T> getIfPresent(@Nonnull DeviceUID device)
device - the DeviceUIDOptional,
or an Optional.empty() if the device is not aligned.public T getLocalValue()
public com.google.common.collect.ImmutableSet<? extends java.util.Map.Entry<DeviceUID,T>> iterable()
public com.google.common.collect.ImmutableSet<DeviceUID> keys()
Iterable for the field keyspublic java.util.stream.Stream<DeviceUID> keyStream()
Stream for the field keyspublic int size()
Fieldpublic java.util.stream.Stream<? extends java.util.Map.Entry<DeviceUID,T>> stream()
Stream over the set of neighbor/value pairspublic com.google.common.collect.ImmutableMap<DeviceUID,T> toMap()
public com.google.common.collect.ImmutableCollection<T> values()
Iterable set of valuespublic java.util.stream.Stream<T> valueStream()
Stream over the set of values