# IResourceEntry

> Represents a single entry in a resource table, identified by a stable key id and carrying per-entry metadata.

## Definition

* **Type:** Interface
* **Namespace:** [Unity.Localization](/engine/6000.7/script-reference/unity/localization.md)
* **Assembly:** UnityEngine.LocalizationRuntimeModule

```csharp
public interface IResourceEntry
```

## Remarks

An entry holds one locale's value for a key. Entries are stored polymorphically in a [ResourceTable](/engine/6000.7/script-reference/unity/localization/resourcetable.md) through `[SerializeReference]`, so string, asset, and custom kinds share one entry list and new kinds drop in without changing the table. [IResourceEntry.KeyId](/engine/6000.7/script-reference/unity/localization/iresourceentry/keyid.md) ties the entry to a shared key in the collection's [SharedTableData](/engine/6000.7/script-reference/unity/localization/sharedtabledata.md), and [IResourceEntry.Metadata](/engine/6000.7/script-reference/unity/localization/iresourceentry/metadata.md) holds comments and custom properties for that entry. Fetch an entry from a table with [ResourceTable.GetEntry](/engine/6000.7/script-reference/unity/localization/resourcetable/getentry.md) or its overloads, then work with it through the value interface that matches its kind, [IStringEntry](/engine/6000.7/script-reference/unity/localization/istringentry.md) or [IAssetEntry](/engine/6000.7/script-reference/unity/localization/iassetentry.md).

Additional Resources: [ResourceTable](/engine/6000.7/script-reference/unity/localization/resourcetable.md), [IStringEntry](/engine/6000.7/script-reference/unity/localization/istringentry.md), [IAssetEntry](/engine/6000.7/script-reference/unity/localization/iassetentry.md), [ResourceEntryBase](/engine/6000.7/script-reference/unity/localization/resourceentrybase.md), [SharedTableData](/engine/6000.7/script-reference/unity/localization/sharedtabledata.md)

Read the key id and metadata of an entry fetched from a table.

## Examples

```csharp
using Unity.Localization;
using UnityEngine;

namespace Unity.Localization.Samples
{
    public class IResourceEntryOverviewExample
    {
        public void Run()
        {
            var shared = ScriptableObject.CreateInstance<SharedTableData>();
            shared.TableCollectionName = "UI Text";

            var table = ScriptableObject.CreateInstance<ResourceTable>();
            table.SharedData = shared;
            table.LocaleIdentifier = new LocaleIdentifier("en");

            table.AddStringEntry("greeting", "Hello");
            IResourceEntry entry = table.GetEntry("greeting");

            Debug.Log(entry.KeyId);             // the stable key id for "greeting"
            Debug.Log(entry.Metadata.HasData);  // False: no metadata attached yet
        }
    }
}
```

## Properties

| Property                                                                                        | Description                                                                 |
| ----------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------- |
| [KeyId](/engine/6000.7/script-reference/unity/localization/iresourceentry/keyid.md)             | The stable key id this entry provides a value for.                          |
| [Metadata](/engine/6000.7/script-reference/unity/localization/iresourceentry/metadata.md)       | The metadata attached to this entry, such as comments or custom properties. |
| [SharedEntry](/engine/6000.7/script-reference/unity/localization/iresourceentry/sharedentry.md) | The shared key data for this entry, common to the key across every locale.  |
| [Table](/engine/6000.7/script-reference/unity/localization/iresourceentry/table.md)             | The table this entry belongs to.                                            |
