120 lines
3.2 KiB
Java
120 lines
3.2 KiB
Java
package com.facebook.share.model;
|
|
|
|
import android.net.Uri;
|
|
import android.os.Parcel;
|
|
import com.facebook.share.model.ShareContent;
|
|
import com.facebook.share.model.ShareContent.Builder;
|
|
import com.facebook.share.model.ShareHashtag;
|
|
import java.util.ArrayList;
|
|
import java.util.Collections;
|
|
import java.util.List;
|
|
|
|
/* loaded from: classes.dex */
|
|
public abstract class ShareContent<P extends ShareContent, E extends Builder> implements ShareModel {
|
|
private final Uri contentUrl;
|
|
private final ShareHashtag hashtag;
|
|
private final List<String> peopleIds;
|
|
private final String placeId;
|
|
private final String ref;
|
|
|
|
public static abstract class Builder<P extends ShareContent, E extends Builder> implements ShareModelBuilder<P, E> {
|
|
private Uri a;
|
|
private List<String> b;
|
|
private String c;
|
|
private String d;
|
|
private ShareHashtag e;
|
|
|
|
public E a(Uri uri) {
|
|
this.a = uri;
|
|
return this;
|
|
}
|
|
|
|
public E b(String str) {
|
|
this.d = str;
|
|
return this;
|
|
}
|
|
|
|
public E a(List<String> list) {
|
|
this.b = list == null ? null : Collections.unmodifiableList(list);
|
|
return this;
|
|
}
|
|
|
|
public E a(String str) {
|
|
this.c = str;
|
|
return this;
|
|
}
|
|
|
|
public E a(P p) {
|
|
if (p == null) {
|
|
return this;
|
|
}
|
|
a(p.getContentUrl());
|
|
a(p.getPeopleIds());
|
|
a(p.getPlaceId());
|
|
b(p.getRef());
|
|
return this;
|
|
}
|
|
}
|
|
|
|
protected ShareContent(Builder builder) {
|
|
this.contentUrl = builder.a;
|
|
this.peopleIds = builder.b;
|
|
this.placeId = builder.c;
|
|
this.ref = builder.d;
|
|
this.hashtag = builder.e;
|
|
}
|
|
|
|
private List<String> readUnmodifiableStringList(Parcel parcel) {
|
|
ArrayList arrayList = new ArrayList();
|
|
parcel.readStringList(arrayList);
|
|
if (arrayList.size() == 0) {
|
|
return null;
|
|
}
|
|
return Collections.unmodifiableList(arrayList);
|
|
}
|
|
|
|
@Override // android.os.Parcelable
|
|
public int describeContents() {
|
|
return 0;
|
|
}
|
|
|
|
public Uri getContentUrl() {
|
|
return this.contentUrl;
|
|
}
|
|
|
|
public List<String> getPeopleIds() {
|
|
return this.peopleIds;
|
|
}
|
|
|
|
public String getPlaceId() {
|
|
return this.placeId;
|
|
}
|
|
|
|
public String getRef() {
|
|
return this.ref;
|
|
}
|
|
|
|
public ShareHashtag getShareHashtag() {
|
|
return this.hashtag;
|
|
}
|
|
|
|
@Override // android.os.Parcelable
|
|
public void writeToParcel(Parcel parcel, int i) {
|
|
parcel.writeParcelable(this.contentUrl, 0);
|
|
parcel.writeStringList(this.peopleIds);
|
|
parcel.writeString(this.placeId);
|
|
parcel.writeString(this.ref);
|
|
parcel.writeParcelable(this.hashtag, 0);
|
|
}
|
|
|
|
protected ShareContent(Parcel parcel) {
|
|
this.contentUrl = (Uri) parcel.readParcelable(Uri.class.getClassLoader());
|
|
this.peopleIds = readUnmodifiableStringList(parcel);
|
|
this.placeId = parcel.readString();
|
|
this.ref = parcel.readString();
|
|
ShareHashtag.Builder builder = new ShareHashtag.Builder();
|
|
builder.a(parcel);
|
|
this.hashtag = builder.a();
|
|
}
|
|
}
|