Record Class Duration
java.lang.Object
java.lang.Record
org.projecthusky.fhir.emed.ch.epr.model.common.Duration
A time quantity (duration).
- Author:
- Quentin Ligier
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal boolean
Indicates whether some other object is "equal to" this one.static Duration
fromQuantity
(org.hl7.fhir.r4.model.Quantity quantity) Creates an instance from an HAPI Quantity.final int
hashCode()
Returns a hash code value for this object.final String
toString()
Returns a string representation of this record class.unit()
Returns the value of theunit
record component.int
value()
Returns the value of thevalue
record component.
-
Constructor Details
-
Duration
Constructor.- Parameters:
value
- The value.unit
- The time unit.
-
-
Method Details
-
fromQuantity
Creates an instance from an HAPI Quantity. -
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared withObjects::equals(Object,Object)
; primitive components are compared with '=='. -
value
public int value()Returns the value of thevalue
record component.- Returns:
- the value of the
value
record component
-
unit
Returns the value of theunit
record component.- Returns:
- the value of the
unit
record component
-