Package kr.toxicity.model.api.animation
Record Class TimedStorage.ListDelegate<T extends Timed>
java.lang.Object
java.lang.Record
kr.toxicity.model.api.animation.TimedStorage.ListDelegate<T>
- Type Parameters:
T- the type of element- Record Components:
list- the backing list
- All Implemented Interfaces:
TimedStorage<T>
- Enclosing interface:
TimedStorage<T extends Timed>
public static record TimedStorage.ListDelegate<T extends Timed>(@NotNull List<T extends Timed> list)
extends Record
implements TimedStorage<T>
A
TimedStorage implementation that delegates to a List.- Since:
- 2.0.0
-
Nested Class Summary
Nested classes/interfaces inherited from interface kr.toxicity.model.api.animation.TimedStorage
TimedStorage.ListDelegate<T extends Timed> -
Constructor Summary
ConstructorsConstructorDescriptionListDelegate(@NotNull List<T> list) Creates an instance of aListDelegaterecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.@NonNull Tget(int index) Retrieves the element at the specified index.@NonNull TgetLast()Retrieves the last element in the storage.final inthashCode()Returns a hash code value for this object.list()Returns the value of thelistrecord component.intsize()Returns the number of elements in the storage.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
ListDelegate
Creates an instance of aListDelegaterecord class.- Parameters:
list- the value for thelistrecord component
-
-
Method Details
-
get
Description copied from interface:TimedStorageRetrieves the element at the specified index.- Specified by:
getin interfaceTimedStorage<T extends Timed>- Parameters:
index- the index of the element- Returns:
- the element
-
size
public int size()Description copied from interface:TimedStorageReturns the number of elements in the storage.- Specified by:
sizein interfaceTimedStorage<T extends Timed>- Returns:
- the size
-
getLast
Description copied from interface:TimedStorageRetrieves the last element in the storage.- Specified by:
getLastin interfaceTimedStorage<T extends Timed>- Returns:
- the last element
-
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. All components in this record class are compared withObjects::equals(Object,Object). -
list
Returns the value of thelistrecord component.- Returns:
- the value of the
listrecord component
-