# Pear class

Namespace: [Grasshopper2.Data](https://developer.rhino3d.com/api/gh2/namespace/grasshopper2.data.md) · Assembly: [Grasshopper2](https://developer.rhino3d.com/api/gh2/assembly/grasshopper2.md)

```cs
public static class Pear
```

Null-safe extension methods for [IPear](https://developer.rhino3d.com/api/gh2/type/grasshopper2.data.ipear.md) and [Pear<T>](https://developer.rhino3d.com/api/gh2/type/grasshopper2.data.pear-1.md).

## Methods

- [Format](https://developer.rhino3d.com/api/gh2/type/grasshopper2.data.pear/format.md): (2 overloads, static) Format a pear with support for nullness.
- [HasMeta](https://developer.rhino3d.com/api/gh2/type/grasshopper2.data.pear/hasmeta.md): (static) Test whether a pear has meta data in a null-safe way. I.e. if the pear is null, false is returned.
- [MergeMetaData](https://developer.rhino3d.com/api/gh2/type/grasshopper2.data.pear/mergemetadata.md): (2 overloads, static) Merge the existing meta data with other meta data.
- [ToStringSafe](https://developer.rhino3d.com/api/gh2/type/grasshopper2.data.pear/tostringsafe.md): (2 overloads, static) Format a pear with support for nullness.
- [ToType<T, TQ>](https://developer.rhino3d.com/api/gh2/type/grasshopper2.data.pear/totype.md): (2 overloads, static) Convert this pear to a target type if possible. This method only attempts direct casting from whatever the current type is to T.
- [TryMeta<T>](https://developer.rhino3d.com/api/gh2/type/grasshopper2.data.pear/trymeta.md): (2 overloads, static) Gets a specific meta value in a null-safe way. If the pear is null or lacks metadata, false is returned.
- [WithItem](https://developer.rhino3d.com/api/gh2/type/grasshopper2.data.pear/withitem.md): (2 overloads, static) Create a new pear with a new item.
- [WithMeta](https://developer.rhino3d.com/api/gh2/type/grasshopper2.data.pear/withmeta.md): (2 overloads, static) Replace the meta data of a pear.
