public final class Temperature implements Comparable


Represents a unit of temperature. Supported units:

Summary

Public methods

static final @NonNull Temperature
celsius(double value)

Creates Temperature with the specified value in Celsius degrees.

int
boolean
equals(Object other)
static final @NonNull Temperature
fahrenheit(double value)

Creates Temperature with the specified value in Fahrenheit degrees.

final double

Returns the temperature in Celsius degrees.

final double

Returns the temperature in Fahrenheit degrees.

int
@NonNull String

Public methods

celsius

Added in 1.1.0-alpha10
public static final @NonNull Temperature celsius(double value)

Creates Temperature with the specified value in Celsius degrees.

compareTo

Added in 1.1.0-alpha10
public int compareTo(@NonNull Temperature other)

equals

public boolean equals(Object other)

fahrenheit

Added in 1.1.0-alpha10
public static final @NonNull Temperature fahrenheit(double value)

Creates Temperature with the specified value in Fahrenheit degrees.

getCelsius

Added in 1.1.0-alpha10
public final double getCelsius()

Returns the temperature in Celsius degrees.

getFahrenheit

Added in 1.1.0-alpha10
public final double getFahrenheit()

Returns the temperature in Fahrenheit degrees.

hashCode

public int hashCode()

toString

public @NonNull String toString()