Record Class CleanRoutine
java.lang.Object
java.lang.Record
br.ufsc.labsec.utils.cleaner.CleanRoutine
- All Implemented Interfaces:
Runnable
A classe CleanRoutine serve para que adicionemos uma rotina de limpeza para variáveis do tipo AutoCloseable
que não tenham sido finalizadas corretamente pelo Garbage Collector
-
Constructor Summary
ConstructorsConstructorDescriptionCleanRoutine(AutoCloseable... closure) Creates an instance of aCleanRoutinerecord class. -
Method Summary
Modifier and TypeMethodDescriptionstatic AutoCloseable[]closeablesFromObject(Object object) closure()Returns the value of theclosurerecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.voidrun()final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
CleanRoutine
Creates an instance of aCleanRoutinerecord class.- Parameters:
closure- the value for theclosurerecord component
-
-
Method Details
-
run
-
closeablesFromObject
-
toString
-
hashCode
-
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. All components in this record class are compared withObjects::equals(Object,Object). -
closure
Returns the value of theclosurerecord component.- Returns:
- the value of the
closurerecord component
-