Package org.waveprotocol.wave.model.wave.data.core.impl

Examples of org.waveprotocol.wave.model.wave.data.core.impl.CoreWaveletDataImpl


  }

  @Override
  public void setUp() throws Exception {
    super.setUp();
    wavelet = new CoreWaveletDataImpl(WAVE_ID, WAVELET_ID);
    originalWavelet = new CoreWaveletDataImpl(WAVE_ID, WAVELET_ID);
  }
View Full Code Here


   * Creates a CoreWaveletData with the given name, documents, and participants.
   */
  private static CoreWaveletData createCoreWaveletData(WaveletName name,
      Map<String, DocOp> documents, ParticipantId... participants)
      throws OperationException {
    CoreWaveletDataImpl data = new CoreWaveletDataImpl(name.waveId, name.waveletId);
    for (ParticipantId p : participants) {
      data.addParticipant(p);
    }
    for (Map.Entry<String, DocOp> d : documents.entrySet()) {
      data.modifyDocument(d.getKey(), d.getValue());
    }
    return data;
  }
View Full Code Here

    // Creating a CoreWaveletData because the current protocol lacks the
    // meta-data required to construct an ObservableWaveletData directly.
    // But this results in unnecessary object creation and copies.
    CoreWaveletData coreWavelet =
        new CoreWaveletDataImpl(waveletName.waveId, waveletName.waveletId);

    Preconditions.checkArgument(snapshot.getParticipantIdCount() > 0);
    // Have to add a single participant for the copying to complete without a
    // NPE.
    coreWavelet.addParticipant(ParticipantId.ofUnsafe(snapshot.getParticipantId(0)));

    for (DocumentSnapshot document : snapshot.getDocumentList()) {
      DocOp op =
          CoreWaveletOperationSerializer.deserialize(document.getDocumentOperation());
      coreWavelet.modifyDocument(document.getDocumentId(), op);
    }

    HashedVersion hashedVersion = CoreWaveletOperationSerializer.deserialize(version);
    ObservableWaveletData immutableWaveletData =
        DataUtil.fromCoreWaveletData(coreWavelet, hashedVersion, SchemaCollection.empty());
View Full Code Here

    // Creating a CoreWaveletData because the current protocol lacks the
    // meta-data required to construct an ObservableWaveletData directly.
    // But this results in unnecessary object creation and copies.
    CoreWaveletData coreWavelet =
        new CoreWaveletDataImpl(waveletName.waveId, waveletName.waveletId);

    Preconditions.checkArgument(snapshot.getParticipantIdCount() > 0);
    // Have to add a single participant for the copying to complete without a
    // NPE.
    coreWavelet.addParticipant(ParticipantId.ofUnsafe(snapshot.getParticipantId(0)));

    for (DocumentSnapshot document : snapshot.getDocumentList()) {
      DocOp op =
          CoreWaveletOperationSerializer.deserialize(document.getDocumentOperation());
      coreWavelet.modifyDocument(document.getDocumentId(), op);
    }

    HashedVersion hashedVersion = CoreWaveletOperationSerializer.deserialize(version);
    ObservableWaveletData immutableWaveletData =
        DataUtil.fromCoreWaveletData(coreWavelet, hashedVersion, SchemaCollection.empty());
View Full Code Here

TOP

Related Classes of org.waveprotocol.wave.model.wave.data.core.impl.CoreWaveletDataImpl

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.