As the value is stored in the datastore, it is converted to the datastore's native type.
This may include widening, such as converting a Short to a Long.
If value is a Collection, the values will be stored in the datastore with the
collection's iteration order with one caveat: all indexed values will come before all unindexed
values (this can occur if the Collection contains both values that are normally indexed
like strings, and values that are never indexed like Blob, Text and EmbeddedEntity).
Overrides any existing value for this property, whether indexed or unindexed.
Like #setProperty, but doesn't index the property in the built-in single property
indexes or the user-defined composite indexes.
See Also: #setProperty
[[["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-08-07 UTC."],[[["\u003cp\u003e\u003ccode\u003ePropertyContainer\u003c/code\u003e is a mutable abstract class in Java that functions as a container for properties, implementing both \u003ccode\u003eSerializable\u003c/code\u003e and \u003ccode\u003eCloneable\u003c/code\u003e interfaces.\u003c/p\u003e\n"],["\u003cp\u003eThe class provides methods to manage properties, including getting, setting, removing, and checking for the existence of properties by name.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003ePropertyContainer\u003c/code\u003e differentiates between indexed and unindexed properties, allowing for the explicit setting of property indexing behavior with methods like \u003ccode\u003esetIndexedProperty\u003c/code\u003e and \u003ccode\u003esetUnindexedProperty\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003eIt includes functionality to clone properties, populate from another \u003ccode\u003ePropertyContainer\u003c/code\u003e, and retrieve all properties as an unmodifiable \u003ccode\u003eMap\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003eThe class has inherited members from the \u003ccode\u003eObject\u003c/code\u003e class such as \u003ccode\u003eclone()\u003c/code\u003e, \u003ccode\u003eequals()\u003c/code\u003e, \u003ccode\u003egetClass()\u003c/code\u003e, \u003ccode\u003ehashCode()\u003c/code\u003e and others, including multiple wait and notify methods.\u003c/p\u003e\n"]]],[],null,["# Class PropertyContainer (2.0.0)\n\n public abstract class PropertyContainer implements Serializable, Cloneable\n\nA mutable property container. \n\nInheritance\n-----------\n\n[Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html) \\\u003e PropertyContainer \n\nImplements\n----------\n\n[Serializable](https://docs.oracle.com/javase/8/docs/api/java/io/Serializable.html), [Cloneable](https://docs.oracle.com/javase/8/docs/api/java/lang/Cloneable.html) \n\nInherited Members\n-----------------\n\n[Object.clone()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#clone--) \n[Object.equals(Object)](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#equals-java.lang.Object-) \n[Object.finalize()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#finalize--) \n[Object.getClass()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#getClass--) \n[Object.hashCode()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#hashCode--) \n[Object.notify()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notify--) \n[Object.notifyAll()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notifyAll--) \n[Object.toString()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#toString--) \n[Object.wait()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait--) \n[Object.wait(long)](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait-long-) \n[Object.wait(long,int)](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait-long-int-)\n\nMethods\n-------\n\n### appendPropertiesTo(StringBuilder builder)\n\n protected void appendPropertiesTo(StringBuilder builder)\n\n### clone()\n\n protected Object clone()\n\n**Overrides** \n[Object.clone()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#clone--)\n\n### getProperties()\n\n public Map\u003cString,@Nullable Object\u003e getProperties()\n\nGets all of the properties belonging to this container.\n\n### getProperty(String propertyName)\n\n public @Nullable Object getProperty(String propertyName)\n\nGets the property with the specified name. The value returned may not be the same type as\noriginally set via [#setProperty](/appengine/docs/standard/java-gen2/reference/services/bundled/latest/com.google.appengine.api.datastore.PropertyContainer#com_google_appengine_api_datastore_PropertyContainer_setProperty_).\n\n### hasProperty(String propertyName)\n\n public boolean hasProperty(String propertyName)\n\nReturns true if a property has been set. If a property has been explicitly set to `null`,\nthis function will return true.\n\n### isUnindexedProperty(String propertyName)\n\n public boolean isUnindexedProperty(String propertyName)\n\nReturns true if `propertyName` has a value that will not be indexed. This includes [Text](/appengine/docs/standard/java-gen2/reference/services/bundled/latest/com.google.appengine.api.datastore.Text), [Blob](/appengine/docs/standard/java-gen2/reference/services/bundled/latest/com.google.appengine.api.datastore.Blob), and any property added using [#setUnindexedProperty](/appengine/docs/standard/java-gen2/reference/services/bundled/latest/com.google.appengine.api.datastore.PropertyContainer#com_google_appengine_api_datastore_PropertyContainer_setUnindexedProperty_).\n\nNote: The behavior of this method is not well defined in case of an indexed property whose\nvalue is a list that contains unindexable values.\n\n### removeProperty(String propertyName)\n\n public void removeProperty(String propertyName)\n\nRemoves any property with the specified name. If there is no property with this name set,\nsimply does nothing.\n\n### setIndexedProperty(String propertyName, Object value)\n\n public void setIndexedProperty(String propertyName, Object value)\n\nLike {link #setProperty}, but requires that the value is indexable or a collection of indexable\nvalues.\n\n### setPropertiesFrom(PropertyContainer src)\n\n public void setPropertiesFrom(PropertyContainer src)\n\nA convenience method that populates properties from those in the given container.\n\nThis method transfers information about unindexed properties and clones any mutable values.\n\n### setProperty(String propertyName, @Nullable Object value)\n\n public void setProperty(String propertyName, @Nullable Object value)\n\nSets the property named, `propertyName`, to `value`.\n\nAs the value is stored in the datastore, it is converted to the datastore's native type.\nThis may include widening, such as converting a `Short` to a `Long`.\n\nIf value is a `Collection`, the values will be stored in the datastore with the\ncollection's iteration order with one caveat: all indexed values will come before all unindexed\nvalues (this can occur if the `Collection` contains both values that are normally indexed\nlike strings, and values that are never indexed like [Blob](/appengine/docs/standard/java-gen2/reference/services/bundled/latest/com.google.appengine.api.datastore.Blob), [Text](/appengine/docs/standard/java-gen2/reference/services/bundled/latest/com.google.appengine.api.datastore.Text) and [EmbeddedEntity](/appengine/docs/standard/java-gen2/reference/services/bundled/latest/com.google.appengine.api.datastore.EmbeddedEntity)).\n\nOverrides any existing value for this property, whether indexed or unindexed.\n\nNote that [Blob](/appengine/docs/standard/java-gen2/reference/services/bundled/latest/com.google.appengine.api.datastore.Blob), [Text](/appengine/docs/standard/java-gen2/reference/services/bundled/latest/com.google.appengine.api.datastore.Text) and [EmbeddedEntity](/appengine/docs/standard/java-gen2/reference/services/bundled/latest/com.google.appengine.api.datastore.EmbeddedEntity) property values are never\nindexed. To store other types without being indexed, use [#setUnindexedProperty](/appengine/docs/standard/java-gen2/reference/services/bundled/latest/com.google.appengine.api.datastore.PropertyContainer#com_google_appengine_api_datastore_PropertyContainer_setUnindexedProperty_).\nSee Also: [#setUnindexedProperty](/appengine/docs/standard/java-gen2/reference/services/bundled/latest/com.google.appengine.api.datastore.PropertyContainer#com_google_appengine_api_datastore_PropertyContainer_setUnindexedProperty_)\n\n### setUnindexedProperty(String propertyName, Object value)\n\n public void setUnindexedProperty(String propertyName, Object value)\n\nLike `#setProperty`, but doesn't index the property in the built-in single property\nindexes or the user-defined composite indexes.\nSee Also: [#setProperty](/appengine/docs/standard/java-gen2/reference/services/bundled/latest/com.google.appengine.api.datastore.PropertyContainer#com_google_appengine_api_datastore_PropertyContainer_setProperty_)"]]