That fuck shit the fascists are using
at master 46 lines 1.2 kB view raw
1package org.tm.archive.sharing; 2 3import androidx.annotation.NonNull; 4import androidx.annotation.Nullable; 5 6import org.tm.archive.recipients.RecipientId; 7 8import java.util.Objects; 9import java.util.Optional; 10 11public final class ShareContact { 12 private final Optional<RecipientId> recipientId; 13 private final String number; 14 15 public ShareContact(@NonNull RecipientId recipientId) { 16 this.recipientId = Optional.of(recipientId); 17 this.number = null; 18 } 19 20 public ShareContact(@NonNull Optional<RecipientId> recipientId, @Nullable String number) { 21 this.recipientId = recipientId; 22 this.number = number; 23 } 24 25 public Optional<RecipientId> getRecipientId() { 26 return recipientId; 27 } 28 29 public String getNumber() { 30 return number; 31 } 32 33 @Override 34 public boolean equals(Object o) { 35 if (this == o) return true; 36 if (o == null || getClass() != o.getClass()) return false; 37 ShareContact that = (ShareContact) o; 38 return recipientId.equals(that.recipientId) && 39 Objects.equals(number, that.number); 40 } 41 42 @Override 43 public int hashCode() { 44 return Objects.hash(recipientId, number); 45 } 46}