public abstract class PropertyContainer implements Serializable, Cloneable
A mutable property container.
Methods
appendPropertiesTo(StringBuilder builder)
protected void appendPropertiesTo(StringBuilder builder)
Parameter | |
---|---|
Name | Description |
builder |
StringBuilder |
clone()
protected Object clone()
Returns | |
---|---|
Type | Description |
Object |
getProperties()
public Map<String,@Nullable Object> getProperties()
Gets all of the properties belonging to this container.
Returns | |
---|---|
Type | Description |
Map<String,@org.checkerframework.checker.nullness.qual.Nullable java.lang.Object> |
an unmodifiable |
getProperty(String propertyName)
public @Nullable Object getProperty(String propertyName)
Gets the property with the specified name. The value returned may not be the same type as originally set via #setProperty.
Parameter | |
---|---|
Name | Description |
propertyName |
String |
Returns | |
---|---|
Type | Description |
@org.checkerframework.checker.nullness.qual.Nullable java.lang.Object |
the property corresponding to |
hasProperty(String propertyName)
public boolean hasProperty(String propertyName)
Returns true if a property has been set. If a property has been explicitly set to null
,
this function will return true.
Parameter | |
---|---|
Name | Description |
propertyName |
String |
Returns | |
---|---|
Type | Description |
boolean |
true iff the property named |
isUnindexedProperty(String propertyName)
public boolean isUnindexedProperty(String propertyName)
Returns true if propertyName
has a value that will not be indexed. This includes Text, Blob, and any property added using #setUnindexedProperty.
Note: The behavior of this method is not well defined in case of an indexed property whose value is a list that contains unindexable values.
Parameter | |
---|---|
Name | Description |
propertyName |
String |
Returns | |
---|---|
Type | Description |
boolean |
removeProperty(String propertyName)
public void removeProperty(String propertyName)
Removes any property with the specified name. If there is no property with this name set, simply does nothing.
Parameter | |
---|---|
Name | Description |
propertyName |
String |
setIndexedProperty(String propertyName, Object value)
public void setIndexedProperty(String propertyName, Object value)
Like {link #setProperty}, but requires that the value is indexable or a collection of indexable values.
Parameters | |
---|---|
Name | Description |
propertyName |
String |
value |
Object |
setPropertiesFrom(PropertyContainer src)
public void setPropertiesFrom(PropertyContainer src)
A convenience method that populates properties from those in the given container.
This method transfers information about unindexed properties and clones any mutable values.
Parameter | |
---|---|
Name | Description |
src |
PropertyContainer The container from which we will populate ourself. |
setProperty(String propertyName, @Nullable Object value)
public void setProperty(String propertyName, @Nullable Object value)
Sets the property named, propertyName
, to value
.
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.
Note that Blob, Text and EmbeddedEntity property values are never indexed. To store other types without being indexed, use #setUnindexedProperty. See Also: #setUnindexedProperty
Parameters | |
---|---|
Name | Description |
propertyName |
String |
value |
@org.checkerframework.checker.nullness.qual.Nullable java.lang.Object may be one of the supported datatypes or a heterogeneous |
setUnindexedProperty(String propertyName, Object value)
public void setUnindexedProperty(String propertyName, Object value)
Like #setProperty
, but doesn't index the property in the built-in single property
indexes or the user-defined composite indexes.
See Also: #setProperty
Parameters | |
---|---|
Name | Description |
propertyName |
String |
value |
Object may be one of the supported datatypes, or a heterogeneous Overrides any existing value for this property, whether indexed or unindexed. |