Use var instead of explicit types

This commit is contained in:
AsamK 2021-02-21 15:01:41 +01:00
parent 03c30519b1
commit de273586b4
77 changed files with 850 additions and 1017 deletions

View file

@ -3,8 +3,6 @@ package org.asamk.signal.json;
import com.fasterxml.jackson.annotation.JsonProperty;
import org.whispersystems.signalservice.api.messages.SignalServiceAttachment;
import org.whispersystems.signalservice.api.messages.SignalServiceAttachmentPointer;
import org.whispersystems.signalservice.api.messages.SignalServiceAttachmentStream;
class JsonAttachment {
@ -24,12 +22,12 @@ class JsonAttachment {
this.contentType = attachment.getContentType();
if (attachment.isPointer()) {
final SignalServiceAttachmentPointer pointer = attachment.asPointer();
final var pointer = attachment.asPointer();
this.id = pointer.getRemoteId().toString();
this.filename = pointer.getFileName().orNull();
this.size = pointer.getSize().transform(Integer::longValue).orNull();
} else {
final SignalServiceAttachmentStream stream = attachment.asStream();
final var stream = attachment.asStream();
this.id = null;
this.filename = stream.getFileName().orNull();
this.size = stream.getLength();