Java 类com.google.gwt.user.client.rpc.SerializationStreamReader 实例源码

项目:googles-monorepo-demo    文件:TreeBasedTable_CustomFieldSerializer.java   
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);
}
项目:googles-monorepo-demo    文件:Table_CustomFieldSerializerBase.java   
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;
}
项目:guava-mock    文件:RegularImmutableMap_CustomFieldSerializer.java   
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);
}
项目:guava-mock    文件:SingletonImmutableTable_CustomFieldSerializer.java   
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);
}
项目:guava-mock    文件:ImmutableTable_CustomFieldSerializerBase.java   
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();
}
项目:googles-monorepo-demo    文件:RegularImmutableBiMap_CustomFieldSerializer.java   
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);
}
项目:googles-monorepo-demo    文件:Multimap_CustomFieldSerializerBase.java   
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();
}
项目:googles-monorepo-demo    文件:RegularImmutableList_CustomFieldSerializer.java   
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);
}
项目:guava-mock    文件:Multimap_CustomFieldSerializerBase.java   
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();
}
项目:guava-mock    文件:Multimap_CustomFieldSerializerBase.java   
@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;
}
项目:googles-monorepo-demo    文件:Multimap_CustomFieldSerializerBase.java   
@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;
}
项目:guava-mock    文件:Multiset_CustomFieldSerializerBase.java   
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;
}
项目:guava-mock    文件:TreeMultimap_CustomFieldSerializer.java   
@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));
}
项目:guava-mock    文件:ImmutableEnumMap_CustomFieldSerializer.java   
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);
}
项目:guava-mock    文件:LinkedListMultimap_CustomFieldSerializer.java   
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;
}
项目:googles-monorepo-demo    文件:ImmutableEnumMap_CustomFieldSerializer.java   
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);
}
项目:guava-mock    文件:RegularImmutableSet_CustomFieldSerializer.java   
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);
}
项目:guava-mock    文件:TreeBasedTable_CustomFieldSerializer.java   
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);
}
项目:googles-monorepo-demo    文件:ImmutableSortedMap_CustomFieldSerializerBase.java   
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();
}
项目:googles-monorepo-demo    文件:SingletonImmutableTable_CustomFieldSerializer.java   
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);
}
项目:googles-monorepo-demo    文件:RegularImmutableMap_CustomFieldSerializer.java   
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);
}
项目:googles-monorepo-demo    文件:ImmutableEnumSet_CustomFieldSerializer.java   
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);
}
项目:googles-monorepo-demo    文件:LinkedListMultimap_CustomFieldSerializer.java   
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;
}
项目:guava-mock    文件:RegularImmutableAsList_CustomFieldSerializer.java   
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);
}
项目:guava-mock    文件:RegularImmutableList_CustomFieldSerializer.java   
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);
}
项目:googles-monorepo-demo    文件:HashMultiset_CustomFieldSerializer.java   
public static HashMultiset<Object> instantiate(SerializationStreamReader reader)
    throws SerializationException {
  return (HashMultiset<Object>)
      Multiset_CustomFieldSerializerBase.populate(reader, HashMultiset.create());
}
项目:guava-mock    文件:PairwiseEquivalence_CustomFieldSerializer.java   
public static void deserialize(
SerializationStreamReader reader, PairwiseEquivalence<?> instance) {}
项目:guava-mock    文件:PairwiseEquivalence_CustomFieldSerializer.java   
public static PairwiseEquivalence<?> instantiate(SerializationStreamReader reader)
    throws SerializationException {
  return create((Equivalence<?>) reader.readObject());
}
项目:googles-monorepo-demo    文件:RegularImmutableMap_CustomFieldSerializer.java   
public static void deserialize(
SerializationStreamReader reader, RegularImmutableMap<?, ?> instance) {}
项目:guava-mock    文件:SingletonImmutableTable_CustomFieldSerializer.java   
public static void deserialize(
SerializationStreamReader reader, SingletonImmutableTable<?, ?, ?> instance) {}
项目:guava-mock    文件:ImmutableSetMultimap_CustomFieldSerializer.java   
public static void deserialize(
SerializationStreamReader reader, ImmutableSetMultimap<?, ?> instance) {}
项目:guava-mock    文件:SingletonImmutableBiMap_CustomFieldSerializer.java   
public static void deserialize(
SerializationStreamReader reader, SingletonImmutableBiMap<?, ?> instance) {}
项目:googles-monorepo-demo    文件:ReverseNaturalOrdering_CustomFieldSerializer.java   
public static void deserialize(
SerializationStreamReader reader, ReverseNaturalOrdering instance) {}
项目:googles-monorepo-demo    文件:ComparatorOrdering_CustomFieldSerializer.java   
@SuppressWarnings("unchecked") // deserialization is unsafe
public static ComparatorOrdering<Object> instantiate(SerializationStreamReader reader)
    throws SerializationException {
  return new ComparatorOrdering<Object>((Comparator<Object>) reader.readObject());
}
项目:guava-mock    文件:ArrayListMultimap_CustomFieldSerializer.java   
public static ArrayListMultimap<Object, Object> instantiate(SerializationStreamReader in)
    throws SerializationException {
  return (ArrayListMultimap<Object, Object>)
      Multimap_CustomFieldSerializerBase.populate(in, ArrayListMultimap.create());
}
项目:googles-monorepo-demo    文件:EmptyImmutableSetMultimap_CustomFieldSerializer.java   
public static void deserialize(
SerializationStreamReader reader, EmptyImmutableSetMultimap instance) {}
项目:guava-mock    文件:RegularImmutableMultiset_CustomFieldSerializer.java   
public static void deserialize(
SerializationStreamReader reader, RegularImmutableMultiset<?> instance) {}
项目:googles-monorepo-demo    文件:ImmutableListMultimap_CustomFieldSerializer.java   
public static void deserialize(
SerializationStreamReader reader, ImmutableListMultimap<?, ?> instance) {}
项目:guava-mock    文件:ImmutableListMultimap_CustomFieldSerializer.java   
public static void deserialize(
SerializationStreamReader reader, ImmutableListMultimap<?, ?> instance) {}
项目:guava-mock    文件:UsingToStringOrdering_CustomFieldSerializer.java   
public static void deserialize(
SerializationStreamReader reader, UsingToStringOrdering instance) {}