150 lines
4.4 KiB
Java
150 lines
4.4 KiB
Java
package com.facebook.share.model;
|
|
|
|
import android.os.Bundle;
|
|
import android.os.Parcel;
|
|
import android.os.Parcelable;
|
|
import com.facebook.share.model.ShareOpenGraphValueContainer;
|
|
import com.facebook.share.model.ShareOpenGraphValueContainer.Builder;
|
|
import java.util.ArrayList;
|
|
import java.util.Iterator;
|
|
import java.util.Set;
|
|
|
|
/* loaded from: classes.dex */
|
|
public abstract class ShareOpenGraphValueContainer<P extends ShareOpenGraphValueContainer, E extends Builder> implements ShareModel {
|
|
private final Bundle bundle;
|
|
|
|
public static abstract class Builder<P extends ShareOpenGraphValueContainer, E extends Builder> implements ShareModelBuilder<P, E> {
|
|
private Bundle a = new Bundle();
|
|
|
|
public E a(String str, String str2) {
|
|
this.a.putString(str, str2);
|
|
return this;
|
|
}
|
|
|
|
public E a(P p) {
|
|
if (p != null) {
|
|
this.a.putAll(p.getBundle());
|
|
}
|
|
return this;
|
|
}
|
|
}
|
|
|
|
protected ShareOpenGraphValueContainer(Builder<P, E> builder) {
|
|
this.bundle = (Bundle) ((Builder) builder).a.clone();
|
|
}
|
|
|
|
@Override // android.os.Parcelable
|
|
public int describeContents() {
|
|
return 0;
|
|
}
|
|
|
|
public Object get(String str) {
|
|
return this.bundle.get(str);
|
|
}
|
|
|
|
public boolean getBoolean(String str, boolean z) {
|
|
return this.bundle.getBoolean(str, z);
|
|
}
|
|
|
|
public boolean[] getBooleanArray(String str) {
|
|
return this.bundle.getBooleanArray(str);
|
|
}
|
|
|
|
public Bundle getBundle() {
|
|
return (Bundle) this.bundle.clone();
|
|
}
|
|
|
|
public double getDouble(String str, double d) {
|
|
return this.bundle.getDouble(str, d);
|
|
}
|
|
|
|
public double[] getDoubleArray(String str) {
|
|
return this.bundle.getDoubleArray(str);
|
|
}
|
|
|
|
public int getInt(String str, int i) {
|
|
return this.bundle.getInt(str, i);
|
|
}
|
|
|
|
public int[] getIntArray(String str) {
|
|
return this.bundle.getIntArray(str);
|
|
}
|
|
|
|
public long getLong(String str, long j) {
|
|
return this.bundle.getLong(str, j);
|
|
}
|
|
|
|
public long[] getLongArray(String str) {
|
|
return this.bundle.getLongArray(str);
|
|
}
|
|
|
|
public ShareOpenGraphObject getObject(String str) {
|
|
Object obj = this.bundle.get(str);
|
|
if (obj instanceof ShareOpenGraphObject) {
|
|
return (ShareOpenGraphObject) obj;
|
|
}
|
|
return null;
|
|
}
|
|
|
|
public ArrayList<ShareOpenGraphObject> getObjectArrayList(String str) {
|
|
ArrayList parcelableArrayList = this.bundle.getParcelableArrayList(str);
|
|
if (parcelableArrayList == null) {
|
|
return null;
|
|
}
|
|
ArrayList<ShareOpenGraphObject> arrayList = new ArrayList<>();
|
|
Iterator it = parcelableArrayList.iterator();
|
|
while (it.hasNext()) {
|
|
Parcelable parcelable = (Parcelable) it.next();
|
|
if (parcelable instanceof ShareOpenGraphObject) {
|
|
arrayList.add((ShareOpenGraphObject) parcelable);
|
|
}
|
|
}
|
|
return arrayList;
|
|
}
|
|
|
|
public SharePhoto getPhoto(String str) {
|
|
Parcelable parcelable = this.bundle.getParcelable(str);
|
|
if (parcelable instanceof SharePhoto) {
|
|
return (SharePhoto) parcelable;
|
|
}
|
|
return null;
|
|
}
|
|
|
|
public ArrayList<SharePhoto> getPhotoArrayList(String str) {
|
|
ArrayList parcelableArrayList = this.bundle.getParcelableArrayList(str);
|
|
if (parcelableArrayList == null) {
|
|
return null;
|
|
}
|
|
ArrayList<SharePhoto> arrayList = new ArrayList<>();
|
|
Iterator it = parcelableArrayList.iterator();
|
|
while (it.hasNext()) {
|
|
Parcelable parcelable = (Parcelable) it.next();
|
|
if (parcelable instanceof SharePhoto) {
|
|
arrayList.add((SharePhoto) parcelable);
|
|
}
|
|
}
|
|
return arrayList;
|
|
}
|
|
|
|
public String getString(String str) {
|
|
return this.bundle.getString(str);
|
|
}
|
|
|
|
public ArrayList<String> getStringArrayList(String str) {
|
|
return this.bundle.getStringArrayList(str);
|
|
}
|
|
|
|
public Set<String> keySet() {
|
|
return this.bundle.keySet();
|
|
}
|
|
|
|
@Override // android.os.Parcelable
|
|
public void writeToParcel(Parcel parcel, int i) {
|
|
parcel.writeBundle(this.bundle);
|
|
}
|
|
|
|
ShareOpenGraphValueContainer(Parcel parcel) {
|
|
this.bundle = parcel.readBundle(Builder.class.getClassLoader());
|
|
}
|
|
}
|