org.whispersystems.signalservice.api.messages.SignalServiceContent Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of signal-service-java Show documentation
Show all versions of signal-service-java Show documentation
Signal Service communication library for Java
/**
* 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;
}
}