public final class Volume implements Comparable


Represents a unit of volume. Supported units:

Summary

Public methods

int
boolean
equals(Object other)
static final @NonNull Volume
fluidOuncesUs(double value)

Creates Volume with the specified value in US fluid ounces.

final double

Returns the volume in US fluid ounces.

final double

Returns the volume in liters.

final double

Returns the volume in milliliters.

int
static final @NonNull Volume
liters(double value)

Creates Volume with the specified value in liters.

static final @NonNull Volume
milliliters(double value)

Creates Volume with the specified value in milliliters.

@NonNull String

Public methods

compareTo

Added in 1.1.0-alpha07
public int compareTo(@NonNull Volume other)

equals

public boolean equals(Object other)

fluidOuncesUs

Added in 1.1.0-alpha07
public static final @NonNull Volume fluidOuncesUs(double value)

Creates Volume with the specified value in US fluid ounces.

getFluidOuncesUs

Added in 1.1.0-alpha07
public final double getFluidOuncesUs()

Returns the volume in US fluid ounces.

getLiters

Added in 1.1.0-alpha07
public final double getLiters()

Returns the volume in liters.

getMilliliters

Added in 1.1.0-alpha07
public final double getMilliliters()

Returns the volume in milliliters.

hashCode

public int hashCode()

liters

Added in 1.1.0-alpha07
public static final @NonNull Volume liters(double value)

Creates Volume with the specified value in liters.

milliliters

Added in 1.1.0-alpha07
public static final @NonNull Volume milliliters(double value)

Creates Volume with the specified value in milliliters.

toString

public @NonNull String toString()