[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-09-04 UTC."],[],[],null,["# Interface Key.PathElementOrBuilder (2.31.2)\n\nVersion latestkeyboard_arrow_down\n\n- [2.31.2 (latest)](/java/docs/reference/google-cloud-datastore/latest/com.google.datastore.v1.Key.PathElementOrBuilder)\n- [2.31.1](/java/docs/reference/google-cloud-datastore/2.31.1/com.google.datastore.v1.Key.PathElementOrBuilder)\n- [2.30.0](/java/docs/reference/google-cloud-datastore/2.30.0/com.google.datastore.v1.Key.PathElementOrBuilder)\n- [2.29.1](/java/docs/reference/google-cloud-datastore/2.29.1/com.google.datastore.v1.Key.PathElementOrBuilder)\n- [2.28.2](/java/docs/reference/google-cloud-datastore/2.28.2/com.google.datastore.v1.Key.PathElementOrBuilder)\n- [2.27.1](/java/docs/reference/google-cloud-datastore/2.27.1/com.google.datastore.v1.Key.PathElementOrBuilder)\n- [2.26.4](/java/docs/reference/google-cloud-datastore/2.26.4/com.google.datastore.v1.Key.PathElementOrBuilder)\n- [2.25.2](/java/docs/reference/google-cloud-datastore/2.25.2/com.google.datastore.v1.Key.PathElementOrBuilder)\n- [2.24.3](/java/docs/reference/google-cloud-datastore/2.24.3/com.google.datastore.v1.Key.PathElementOrBuilder)\n- [2.23.0](/java/docs/reference/google-cloud-datastore/2.23.0/com.google.datastore.v1.Key.PathElementOrBuilder)\n- [2.22.0](/java/docs/reference/google-cloud-datastore/2.22.0/com.google.datastore.v1.Key.PathElementOrBuilder)\n- [2.21.3](/java/docs/reference/google-cloud-datastore/2.21.3/com.google.datastore.v1.Key.PathElementOrBuilder)\n- [2.20.2](/java/docs/reference/google-cloud-datastore/2.20.2/com.google.datastore.v1.Key.PathElementOrBuilder)\n- [2.19.2](/java/docs/reference/google-cloud-datastore/2.19.2/com.google.datastore.v1.Key.PathElementOrBuilder)\n- [2.18.5](/java/docs/reference/google-cloud-datastore/2.18.5/com.google.datastore.v1.Key.PathElementOrBuilder)\n- [2.17.6](/java/docs/reference/google-cloud-datastore/2.17.6/com.google.datastore.v1.Key.PathElementOrBuilder) \n\n public static interface Key.PathElementOrBuilder extends MessageOrBuilder\n\nImplements\n----------\n\n[MessageOrBuilder](https://cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.MessageOrBuilder.html)\n\nMethods\n-------\n\n### getId()\n\n public abstract long getId()\n\nThe auto-allocated ID of the entity.\n\nNever equal to zero. Values less than zero are discouraged and may not\nbe supported in the future.\n\n`int64 id = 2;`\n\n### getIdTypeCase()\n\n public abstract Key.PathElement.IdTypeCase getIdTypeCase()\n\n### getKind()\n\n public abstract String getKind()\n\nThe kind of the entity.\n\nA kind matching regex **.*** is reserved/read-only.\nA kind must not contain more than 1500 bytes when UTF-8 encoded.\nCannot be `\"\"`.\n\nMust be valid UTF-8 bytes. Legacy values that are not valid UTF-8 are\nencoded as **bytes\u003cX\u003e** where `\u003cX\u003e` is the base-64 encoding of the\nbytes.\n\n`string kind = 1;`\n\n### getKindBytes()\n\n public abstract ByteString getKindBytes()\n\nThe kind of the entity.\n\nA kind matching regex **.*** is reserved/read-only.\nA kind must not contain more than 1500 bytes when UTF-8 encoded.\nCannot be `\"\"`.\n\nMust be valid UTF-8 bytes. Legacy values that are not valid UTF-8 are\nencoded as **bytes\u003cX\u003e** where `\u003cX\u003e` is the base-64 encoding of the\nbytes.\n\n`string kind = 1;`\n\n### getName()\n\n public abstract String getName()\n\nThe name of the entity.\n\nA name matching regex **.*** is reserved/read-only.\nA name must not be more than 1500 bytes when UTF-8 encoded.\nCannot be `\"\"`.\n\nMust be valid UTF-8 bytes. Legacy values that are not valid UTF-8 are\nencoded as **bytes\u003cX\u003e** where `\u003cX\u003e` is the base-64 encoding of the\nbytes.\n\n`string name = 3;`\n\n### getNameBytes()\n\n public abstract ByteString getNameBytes()\n\nThe name of the entity.\n\nA name matching regex **.*** is reserved/read-only.\nA name must not be more than 1500 bytes when UTF-8 encoded.\nCannot be `\"\"`.\n\nMust be valid UTF-8 bytes. Legacy values that are not valid UTF-8 are\nencoded as **bytes\u003cX\u003e** where `\u003cX\u003e` is the base-64 encoding of the\nbytes.\n\n`string name = 3;`\n\n### hasId()\n\n public abstract boolean hasId()\n\nThe auto-allocated ID of the entity.\n\nNever equal to zero. Values less than zero are discouraged and may not\nbe supported in the future.\n\n`int64 id = 2;`\n\n### hasName()\n\n public abstract boolean hasName()\n\nThe name of the entity.\n\nA name matching regex **.*** is reserved/read-only.\nA name must not be more than 1500 bytes when UTF-8 encoded.\nCannot be `\"\"`.\n\nMust be valid UTF-8 bytes. Legacy values that are not valid UTF-8 are\nencoded as **bytes\u003cX\u003e** where `\u003cX\u003e` is the base-64 encoding of the\nbytes.\n\n`string name = 3;`"]]