Skip to content

Instantly share code, notes, and snippets.

@madsunrise
Created June 20, 2018 09:47
Show Gist options
  • Save madsunrise/2d28e9f73d791f9b5e1de27574da8047 to your computer and use it in GitHub Desktop.
Save madsunrise/2d28e9f73d791f9b5e1de27574da8047 to your computer and use it in GitHub Desktop.
public class PayInfo implements Parcelable {
// цена
private final BigDecimal price;
public PayInfo(BigDecimal price) {
this.price = price;
}
private PayInfo(Parcel parcel) {
price = (BigDecimal) parcel.readSerializable();
}
public BigDecimal getPrice() {
return price;
}
@Override
public int describeContents() {
return 0;
}
@Override
public void writeToParcel(Parcel parcel, int i) {
parcel.writeSerializable(price);
}
public static final Creator<PayInfo> CREATOR = new Creator<PayInfo>() {
public PayInfo createFromParcel(Parcel in) {
return new PayInfo(in);
}
public PayInfo[] newArray(int size) {
return new PayInfo[size];
}
};
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment