List of usage examples for com.google.common.collect ImmutableMultimap getClass
@HotSpotIntrinsicCandidate public final native Class<?> getClass();
From source file:com.google.devtools.build.lib.skyframe.serialization.ImmutableMultimapCodec.java
@Override public void serialize(SerializationContext context, ImmutableMultimap<K, V> obj, CodedOutputStream codedOut) throws SerializationException, IOException { if (obj instanceof ImmutableListMultimap) { codedOut.writeBoolNoTag(true);//from w w w . j av a 2s . c o m } else if (obj instanceof ImmutableSetMultimap) { codedOut.writeBoolNoTag(false); } else { throw new SerializationException("Unexpected multimap type: " + obj.getClass()); } codedOut.writeInt32NoTag(obj.asMap().size()); for (Map.Entry<K, Collection<V>> entry : obj.asMap().entrySet()) { context.serialize(entry.getKey(), codedOut); context.serialize(entry.getValue(), codedOut); } }