# CachedMessage Methods

[Type overview](/orleans/docs/api/csharp/microsoft.orleans.streaming/orleans.providers.streams.common.cachedmessage/)

## Equals(object?) {#equals-object-nullable-b02928f2}

[Dedicated page](/orleans/docs/api/csharp/microsoft.orleans.streaming/orleans.providers.streams.common.cachedmessage/methods/equals-object-nullable-b02928f2/)

[Source](https://github.com/dotnet/orleans/blob/1644940b035c7bdf215a4fd7135757c06bcfe9ec/src/Orleans.Streaming/Common/PooledCache/CachedMessage.cs#L54)

```csharp
public override readonly bool Equals(object? obj)
```

Indicates whether this instance and a specified object are equal.

### Parameters

- `obj` (`object?`): The object to compare with the current instance.

### Returns

`true` if `obj` and this instance are the same type and represent the same value; otherwise, `false`.

## Equals(CachedMessage) {#equals-orleans-providers-streams-common-cachedmessage-531f4a7c}

[Dedicated page](/orleans/docs/api/csharp/microsoft.orleans.streaming/orleans.providers.streams.common.cachedmessage/methods/equals-orleans-providers-streams-common-cachedmessage-531f4a7c/)

[Source](https://github.com/dotnet/orleans/blob/1644940b035c7bdf215a4fd7135757c06bcfe9ec/src/Orleans.Streaming/Common/PooledCache/CachedMessage.cs#L46-L51)

```csharp
public readonly bool Equals(CachedMessage other)
```

Indicates whether the current object is equal to another object of the same type.

### Parameters

- `other` (`CachedMessage`): An object to compare with this object.

### Returns

`true` if the current object is equal to the `other` parameter; otherwise, `false`.

## GetHashCode {#gethashcode-af9b87c6}

[Dedicated page](/orleans/docs/api/csharp/microsoft.orleans.streaming/orleans.providers.streams.common.cachedmessage/methods/gethashcode-af9b87c6/)

[Source](https://github.com/dotnet/orleans/blob/1644940b035c7bdf215a4fd7135757c06bcfe9ec/src/Orleans.Streaming/Common/PooledCache/CachedMessage.cs#L58)

```csharp
public override readonly int GetHashCode()
```

Returns the hash code for this instance.

### Returns

A 32-bit signed integer that is the hash code for this instance.

## operator ==(CachedMessage, CachedMessage) {#op-equality-orleans-providers-streams-common-cachedmessage-orleans-providers-str-4601450d}

[Dedicated page](/orleans/docs/api/csharp/microsoft.orleans.streaming/orleans.providers.streams.common.cachedmessage/methods/op-equality-orleans-providers-streams-common-cachedmessage-orleans-providers-str-4601450d/)

[Source](https://github.com/dotnet/orleans/blob/1644940b035c7bdf215a4fd7135757c06bcfe9ec/src/Orleans.Streaming/Common/PooledCache/CachedMessage.cs#L63)

```csharp
public static bool operator ==(CachedMessage left, CachedMessage right)
```

Determines whether two cached messages are equal.

### Parameters

- `left` (`CachedMessage`)
- `right` (`CachedMessage`)

## operator !=(CachedMessage, CachedMessage) {#op-inequality-orleans-providers-streams-common-cachedmessage-orleans-providers-s-e3d8bae1}

[Dedicated page](/orleans/docs/api/csharp/microsoft.orleans.streaming/orleans.providers.streams.common.cachedmessage/methods/op-inequality-orleans-providers-streams-common-cachedmessage-orleans-providers-s-e3d8bae1/)

[Source](https://github.com/dotnet/orleans/blob/1644940b035c7bdf215a4fd7135757c06bcfe9ec/src/Orleans.Streaming/Common/PooledCache/CachedMessage.cs#L68)

```csharp
public static bool operator !=(CachedMessage left, CachedMessage right)
```

Determines whether two cached messages are unequal.

### Parameters

- `left` (`CachedMessage`)
- `right` (`CachedMessage`)
