# Class PoolItem
Namespace: [CapyKit](CapyKit.md)
Assembly: CapyKit.dll
A pool item. This class cannot be inherited.
```csharp
public sealed class PoolItem
```
#### Type Parameters
`T`
The type of the pooled item.
#### Inheritance
[object](https://learn.microsoft.com/dotnet/api/system.object) ←
[PoolItem](CapyKit.PoolItem\-1.md)
#### Inherited Members
[object.Equals\(object?\)](https://learn.microsoft.com/dotnet/api/system.object.equals\#system\-object\-equals\(system\-object\)),
[object.Equals\(object?, object?\)](https://learn.microsoft.com/dotnet/api/system.object.equals\#system\-object\-equals\(system\-object\-system\-object\)),
[object.GetHashCode\(\)](https://learn.microsoft.com/dotnet/api/system.object.gethashcode),
[object.GetType\(\)](https://learn.microsoft.com/dotnet/api/system.object.gettype),
[object.ReferenceEquals\(object?, object?\)](https://learn.microsoft.com/dotnet/api/system.object.referenceequals),
[object.ToString\(\)](https://learn.microsoft.com/dotnet/api/system.object.tostring)
#### Extension Methods
[ObjectExtensions.UpdateProperties\>\(PoolItem, PoolItem\)](CapyKit.Extensions.ObjectExtensions.md\#CapyKit\_Extensions\_ObjectExtensions\_UpdateProperties\_\_1\_\_\_0\_\_\_0\_),
[ObjectExtensions.UpdateProperties\(object, object\)](CapyKit.Extensions.ObjectExtensions.md\#CapyKit\_Extensions\_ObjectExtensions\_UpdateProperties\_System\_Object\_System\_Object\_)
## Properties
### Index
Gets the zero-based index of the pooled item.
```csharp
public int Index { get; }
```
#### Property Value
[int](https://learn.microsoft.com/dotnet/api/system.int32)
### Item
Gets the pooled resource.
```csharp
public T Item { get; }
```
#### Property Value
T
### Locked
Gets a value indicating whether this object is locked or not.
```csharp
public bool Locked { get; }
```
#### Property Value
[bool](https://learn.microsoft.com/dotnet/api/system.boolean)
### TypeName
Gets the name of the of the pooled item.
```csharp
public string TypeName { get; }
```
#### Property Value
[string](https://learn.microsoft.com/dotnet/api/system.string)
## Methods
### ReleaseLock\(\)
Releases the lock on the item.
```csharp
public void ReleaseLock()
```
#### Remarks
If the item is not locked, an error event is emitted.
### SetLock\(\)
Sets the lock on the item indicating that it is in use.
```csharp
public bool SetLock()
```
#### Returns
[bool](https://learn.microsoft.com/dotnet/api/system.boolean)
true if the item is locked successfully, false if it
fails.
#### Remarks
If the item is already locked, an error event is emitted.
### ToString\(\)
Returns a string that represents the current object and its lock state.
```csharp
public override string ToString()
```
#### Returns
[string](https://learn.microsoft.com/dotnet/api/system.string)
A string that represents the current object and its lock state.