All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.whispersystems.signalservice.api.messages.SignalServiceContent Maven / Gradle / Ivy

There is a newer version: 2.15.3
Show newest version
/**
 * Copyright (C) 2014-2016 Open Whisper Systems
 *
 * Licensed according to the LICENSE file in this repository.
 */

package org.whispersystems.signalservice.api.messages;

import org.whispersystems.libsignal.util.guava.Optional;
import org.whispersystems.signalservice.api.messages.multidevice.SignalServiceSyncMessage;

public class SignalServiceContent {

  private final Optional message;
  private final Optional synchronizeMessage;

  public SignalServiceContent() {
    this.message            = Optional.absent();
    this.synchronizeMessage = Optional.absent();
  }

  public SignalServiceContent(SignalServiceDataMessage message) {
    this.message = Optional.fromNullable(message);
    this.synchronizeMessage = Optional.absent();
  }

  public SignalServiceContent(SignalServiceSyncMessage synchronizeMessage) {
    this.message            = Optional.absent();
    this.synchronizeMessage = Optional.fromNullable(synchronizeMessage);
  }

  public Optional getDataMessage() {
    return message;
  }

  public Optional getSyncMessage() {
    return synchronizeMessage;
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy