public static TreeBasedTable<Object, Object, Object> instantiate(SerializationStreamReader reader) throws SerializationException { @SuppressWarnings("unchecked") // The comparator isn't used statically. Comparator<Object> rowComparator = (Comparator<Object>) reader.readObject(); @SuppressWarnings("unchecked") // The comparator isn't used statically. Comparator<Object> columnComparator = (Comparator<Object>) reader.readObject(); TreeBasedTable<Object, Object, Object> table = TreeBasedTable.create(rowComparator, columnComparator); return Table_CustomFieldSerializerBase.populate(reader, table); }
static <T extends StandardTable<Object, Object, Object>> T populate( SerializationStreamReader reader, T table) throws SerializationException { Map<?, ?> hashMap = (Map<?, ?>) reader.readObject(); for (Entry<?, ?> row : hashMap.entrySet()) { table.row(row.getKey()).putAll((Map<?, ?>) row.getValue()); } return table; }
public static RegularImmutableMap<Object, Object> instantiate(SerializationStreamReader reader) throws SerializationException { Map<Object, Object> entries = new LinkedHashMap<Object, Object>(); Map_CustomFieldSerializerBase.deserialize(reader, entries); /* * For this custom field serializer to be invoked, the map must have been * RegularImmutableMap before it's serialized. Since RegularImmutableMap * always have two or more elements, ImmutableMap.copyOf always return * a RegularImmutableMap back. */ return (RegularImmutableMap<Object, Object>) ImmutableMap.copyOf(entries); }
public static SingletonImmutableTable<Object, Object, Object> instantiate( SerializationStreamReader reader) throws SerializationException { Object rowKey = reader.readObject(); Object columnKey = reader.readObject(); Object value = reader.readObject(); return new SingletonImmutableTable<Object, Object, Object>(rowKey, columnKey, value); }
public static ImmutableTable<Object, Object, Object> instantiate(SerializationStreamReader reader) throws SerializationException { ImmutableTable.Builder<Object, Object, Object> builder = ImmutableTable.builder(); int rowCount = reader.readInt(); for (int i = 0; i < rowCount; i++) { Object rowKey = reader.readObject(); int colCount = reader.readInt(); for (int j = 0; j < colCount; j++) { builder.put(rowKey, reader.readObject(), reader.readObject()); } } return builder.build(); }
public static RegularImmutableBiMap<Object, Object> instantiate(SerializationStreamReader reader) throws SerializationException { Map<Object, Object> entries = new LinkedHashMap<Object, Object>(); Map_CustomFieldSerializerBase.deserialize(reader, entries); /* * For this custom field serializer to be invoked, the map must have been * RegularImmutableBiMap before it's serialized. Since RegularImmutableBiMap * always have one or more elements, ImmutableBiMap.copyOf always return a * RegularImmutableBiMap back. */ return (RegularImmutableBiMap<Object, Object>) ImmutableBiMap.copyOf(entries); }
static ImmutableMultimap<Object, Object> instantiate( SerializationStreamReader reader, ImmutableMultimap.Builder<Object, Object> builder) throws SerializationException { int keyCount = reader.readInt(); for (int i = 0; i < keyCount; ++i) { Object key = reader.readObject(); int valueCount = reader.readInt(); for (int j = 0; j < valueCount; ++j) { Object value = reader.readObject(); builder.put(key, value); } } return builder.build(); }
public static RegularImmutableList<Object> instantiate(SerializationStreamReader reader) throws SerializationException { List<Object> elements = new ArrayList<Object>(); Collection_CustomFieldSerializerBase.deserialize(reader, elements); /* * For this custom field serializer to be invoked, the list must have been * RegularImmutableList before it's serialized. Since RegularImmutableList * always have one or more elements, ImmutableList.copyOf always return * a RegularImmutableList back. */ return (RegularImmutableList<Object>) ImmutableList.copyOf(elements); }
@CanIgnoreReturnValue public static Multimap<Object, Object> populate( SerializationStreamReader reader, Multimap<Object, Object> multimap) throws SerializationException { int keyCount = reader.readInt(); for (int i = 0; i < keyCount; ++i) { Object key = reader.readObject(); int valueCount = reader.readInt(); for (int j = 0; j < valueCount; ++j) { Object value = reader.readObject(); multimap.put(key, value); } } return multimap; }
static Multiset<Object> populate(SerializationStreamReader reader, Multiset<Object> multiset) throws SerializationException { int distinctElements = reader.readInt(); for (int i = 0; i < distinctElements; i++) { Object element = reader.readObject(); int count = reader.readInt(); multiset.add(element, count); } return multiset; }
@SuppressWarnings("unchecked") public static TreeMultimap<Object, Object> instantiate(SerializationStreamReader in) throws SerializationException { Comparator<Object> keyComparator = (Comparator<Object>) in.readObject(); Comparator<Object> valueComparator = (Comparator<Object>) in.readObject(); return (TreeMultimap<Object, Object>) Multimap_CustomFieldSerializerBase.populate( in, TreeMultimap.create(keyComparator, valueComparator)); }
public static <K extends Enum<K>, V> ImmutableEnumMap<?, ?> instantiate( SerializationStreamReader reader) throws SerializationException { Map<K, V> deserialized = Maps.newHashMap(); Map_CustomFieldSerializerBase.deserialize(reader, deserialized); /* * It is safe to cast to ImmutableEnumSet because in order for it to be * serialized as an ImmutableEnumSet, it must be non-empty to start * with. */ return (ImmutableEnumMap<?, ?>) Maps.immutableEnumMap(deserialized); }
public static LinkedListMultimap<Object, Object> instantiate(SerializationStreamReader in) throws SerializationException { LinkedListMultimap<Object, Object> multimap = LinkedListMultimap.create(); int size = in.readInt(); for (int i = 0; i < size; i++) { Object key = in.readObject(); Object value = in.readObject(); multimap.put(key, value); } return multimap; }
public static RegularImmutableSet<Object> instantiate(SerializationStreamReader reader) throws SerializationException { List<Object> elements = Lists.newArrayList(); Collection_CustomFieldSerializerBase.deserialize(reader, elements); /* * For this custom field serializer to be invoked, the set must have been * RegularImmutableSet before it's serialized. Since RegularImmutableSet * always have two or more elements, ImmutableSet.copyOf always return * a RegularImmutableSet back. */ return (RegularImmutableSet<Object>) ImmutableSet.copyOf(elements); }
static ImmutableSortedMap<Object, Object> instantiate(SerializationStreamReader reader) throws SerializationException { /* * Nothing we can do, but we're already assuming the serialized form is * correctly typed, anyway. */ @SuppressWarnings("unchecked") Comparator<Object> comparator = (Comparator<Object>) reader.readObject(); SortedMap<Object, Object> entries = new TreeMap<Object, Object>(comparator); Map_CustomFieldSerializerBase.deserialize(reader, entries); return ImmutableSortedMap.orderedBy(comparator).putAll(entries).build(); }
public static <E extends Enum<E>> ImmutableEnumSet<?> instantiate( SerializationStreamReader reader) throws SerializationException { List<E> deserialized = Lists.newArrayList(); Collection_CustomFieldSerializerBase.deserialize(reader, deserialized); /* * It is safe to cast to ImmutableEnumSet because in order for it to be * serialized as an ImmutableEnumSet, it must be non-empty to start * with. */ return (ImmutableEnumSet<?>) Sets.immutableEnumSet(deserialized); }
public static RegularImmutableAsList<Object> instantiate(SerializationStreamReader reader) throws SerializationException { ArrayList<Object> elements = new ArrayList<Object>(); Collection_CustomFieldSerializerBase.deserialize(reader, elements); ImmutableList<Object> delegate = ImmutableList.copyOf(elements); return new RegularImmutableAsList<Object>(delegate, delegate); }
public static HashMultiset<Object> instantiate(SerializationStreamReader reader) throws SerializationException { return (HashMultiset<Object>) Multiset_CustomFieldSerializerBase.populate(reader, HashMultiset.create()); }
public static void deserialize( SerializationStreamReader reader, PairwiseEquivalence<?> instance) {}
public static PairwiseEquivalence<?> instantiate(SerializationStreamReader reader) throws SerializationException { return create((Equivalence<?>) reader.readObject()); }
public static void deserialize( SerializationStreamReader reader, RegularImmutableMap<?, ?> instance) {}
public static void deserialize( SerializationStreamReader reader, SingletonImmutableTable<?, ?, ?> instance) {}
public static void deserialize( SerializationStreamReader reader, ImmutableSetMultimap<?, ?> instance) {}
public static void deserialize( SerializationStreamReader reader, SingletonImmutableBiMap<?, ?> instance) {}
public static void deserialize( SerializationStreamReader reader, ReverseNaturalOrdering instance) {}
@SuppressWarnings("unchecked") // deserialization is unsafe public static ComparatorOrdering<Object> instantiate(SerializationStreamReader reader) throws SerializationException { return new ComparatorOrdering<Object>((Comparator<Object>) reader.readObject()); }
public static ArrayListMultimap<Object, Object> instantiate(SerializationStreamReader in) throws SerializationException { return (ArrayListMultimap<Object, Object>) Multimap_CustomFieldSerializerBase.populate(in, ArrayListMultimap.create()); }
public static void deserialize( SerializationStreamReader reader, EmptyImmutableSetMultimap instance) {}
public static void deserialize( SerializationStreamReader reader, RegularImmutableMultiset<?> instance) {}
public static void deserialize( SerializationStreamReader reader, ImmutableListMultimap<?, ?> instance) {}
public static void deserialize( SerializationStreamReader reader, UsingToStringOrdering instance) {}