public abstract class PriceEstimate extends Object implements Parcelable
if (priceEstimate.isFixedPrice()) {
Price price = priceEstimate.getFixedPrice();
// Do things
} else {
PriceRange range = priceEstimate.getPriceRange();
// Do things
}
Parcelable.ClassLoaderCreator<T>, Parcelable.Creator<T>
CONTENTS_FILE_DESCRIPTOR, PARCELABLE_WRITE_RETURN_VALUE
Constructor and Description |
---|
PriceEstimate() |
Modifier and Type | Method and Description |
---|---|
static PriceEstimate |
create(Price fixedPrice)
Create new price estimation with fixed price.
|
static PriceEstimate |
create(PriceRange range)
Create new price estimation with price range.
|
abstract Price |
getFixedPrice()
The fixed price, if exists.
|
abstract PriceRange |
getPriceRange()
The price range, if exists.
|
boolean |
isFixedPrice()
Whether the estimation is a fixed price.
|
boolean |
isRange()
Whether the estimation is a range.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
describeContents, writeToParcel
public static PriceEstimate create(Price fixedPrice)
fixedPrice
- The fixed pricepublic static PriceEstimate create(PriceRange range)
range
- The price rangepublic boolean isFixedPrice()
public boolean isRange()
public abstract Price getFixedPrice()
public abstract PriceRange getPriceRange()