Module org.apache.jena.arq
Package org.apache.jena.sparql.engine
Record Class Timeouts.DurationWithUnit
java.lang.Object
java.lang.Record
org.apache.jena.sparql.engine.Timeouts.DurationWithUnit
- Enclosing class:
- Timeouts
-
Field Summary
-
Constructor Summary
ConstructorDescriptionDurationWithUnit
(long amount, TimeUnit unit) Creates an instance of aDurationWithUnit
record class. -
Method Summary
Modifier and TypeMethodDescriptionlong
amount()
Returns the value of theamount
record component.long
asMillis()
final boolean
Indicates whether some other object is "equal to" this one.final int
hashCode()
Returns a hash code value for this object.boolean
isSet()
static Timeouts.DurationWithUnit
Create an instance with normalized values: negative amounts become -1 and a null unit is turned into milliseconds.final String
toString()
Returns a string representation of this record class.unit()
Returns the value of theunit
record component.
-
Field Details
-
UNSET
-
-
Constructor Details
-
DurationWithUnit
Creates an instance of aDurationWithUnit
record class.- Parameters:
amount
- the value for theamount
record componentunit
- the value for theunit
record component
-
-
Method Details
-
isSet
public boolean isSet() -
asMillis
public long asMillis() -
of
Create an instance with normalized values: negative amounts become -1 and a null unit is turned into milliseconds. -
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 '=='. -
amount
public long amount()Returns the value of theamount
record component.- Returns:
- the value of the
amount
record component
-
unit
Returns the value of theunit
record component.- Returns:
- the value of the
unit
record component
-