That fuck shit the fascists are using
at master 52 lines 1.2 kB view raw
1package org.tm.archive.groups; 2 3import android.os.Parcel; 4import android.os.Parcelable; 5 6import androidx.annotation.Nullable; 7 8public final class ParcelableGroupId implements Parcelable { 9 10 private final GroupId groupId; 11 12 public static ParcelableGroupId from(@Nullable GroupId groupId) { 13 return new ParcelableGroupId(groupId); 14 } 15 16 public static @Nullable GroupId get(@Nullable ParcelableGroupId parcelableGroupId) { 17 if (parcelableGroupId == null) { 18 return null; 19 } 20 return parcelableGroupId.groupId; 21 } 22 23 ParcelableGroupId(@Nullable GroupId groupId) { 24 this.groupId = groupId; 25 } 26 27 @Override 28 public void writeToParcel(Parcel dest, int flags) { 29 if (groupId != null) { 30 dest.writeString(groupId.toString()); 31 } else { 32 dest.writeString(null); 33 } 34 } 35 36 @Override 37 public int describeContents() { 38 return 0; 39 } 40 41 public static final Creator<ParcelableGroupId> CREATOR = new Creator<ParcelableGroupId>() { 42 @Override 43 public ParcelableGroupId createFromParcel(Parcel in) { 44 return new ParcelableGroupId(GroupId.parseNullableOrThrow(in.readString())); 45 } 46 47 @Override 48 public ParcelableGroupId[] newArray(int size) { 49 return new ParcelableGroupId[size]; 50 } 51 }; 52}