> Documentation index: https://firebase.google.com/docs/reference/llms.txt

# BsonObjectId


```
public final class BsonObjectId
```

<br />

*** ** * ** ***

Represents a BSON `ObjectId` type in Firestore documents.

## Summary

| ### Public fields |
|---|---|
| `final String` | `value` |

| ### Public constructors |
|---|
| `BsonObjectId(@NonNull String oid)` Constructor that creates a new BSON `ObjectId` value with the given value. |

| ### Public methods |
|---|---|
| `boolean` | `equals(Object obj)` Returns true if this `BsonObjectId` is equal to the provided object. |
| `int` | `hashCode()` |
| `String` | `toString()` |

## Public fields

### value

```
public final String value
```

## Public constructors

### BsonObjectId

```
public BsonObjectId(@NonNull String oid)
```

Constructor that creates a new BSON `ObjectId` value with the given value.

| Parameters |
|---|---|
| `@NonNull String oid` | The 24-character hex string representing the `ObjectId`. |

## Public methods

### equals

```
public boolean equals(Object obj)
```

Returns true if this `BsonObjectId` is equal to the provided object.

| Parameters |
|---|---|
| `Object obj` | The object to compare against. |

| Returns |
|---|---|
| `boolean` | Whether this `BsonObjectId` is equal to the provided object. |

### hashCode

```
public int hashCode()
```

### toString

```
public String toString()
```