public class Person extends Entity {
public static final EntityType TYPE = new EntityType() {{
string(Thing.name);
string(Thing.description);
}};
{
setEntityType(TYPE);
}
}
public class SimpleEntityWrapper extends Object implements Entity
| Modifier | Constructor and Description |
|---|---|
protected |
SimpleEntityWrapper(Entity entity) |
| Modifier and Type | Method and Description |
|---|---|
void |
add(Property prop,
Entity value)
Adds an item to the given property.
|
void |
addPropertyChangeListener(ActionListener<PropertyChangeEvent> l)
Adds a listener to listen to all property changes on all properties.
|
void |
addPropertyChangeListener(Property property,
ActionListener<PropertyChangeEvent> l)
Adds a listener to be notified of changes to the given property.
|
void |
addVetoablePropertyChangeListener(ActionListener<VetoablePropertyChangeEvent> l)
Adds a listener to listen to all property changes on all properties.
|
void |
addVetoablePropertyChangeListener(Property property,
ActionListener<VetoablePropertyChangeEvent> l)
Adds a listener to be notified of changes to the given property.
|
<T> boolean |
as(Class<T> cls,
SuccessCallback<T> callback) |
Image |
createImageToFile(Property prop,
EncodedImage placeholder)
Creates an image for a given property to file system.
|
Image |
createImageToFile(Property prop,
EncodedImage placeholder,
String file)
Creates an image for a given property to file system.This behaves similarly to the
URLImage.createToFileSystem(com.codename1.ui.EncodedImage, java.lang.String, java.lang.String, com.codename1.ui.URLImage.ImageAdapter)
except the URL is retrieved from the entity’s property, instead of as a parameter. |
Image |
createImageToFile(Property prop,
EncodedImage placeholder,
String file,
URLImage.ImageAdapter adapter)
Creates an image for a given property to file system.This behaves similarly to the
URLImage.createToFileSystem(com.codename1.ui.EncodedImage, java.lang.String, java.lang.String, com.codename1.ui.URLImage.ImageAdapter)
except the URL is retrieved from the entity’s property, instead of as a parameter. |
Image |
createImageToFile(Property prop,
EncodedImage placeholder,
URLImage.ImageAdapter adapter)
Creates an image for a given property to file system.
|
Image |
createImageToFile(Tag tag,
EncodedImage placeholder)
Creates an image for a given property to file system.
|
Image |
createImageToFile(Tag tag,
EncodedImage placeholder,
String file)
Creates an image for a given property to file system.This behaves similarly to the
URLImage.createToFileSystem(com.codename1.ui.EncodedImage, java.lang.String, java.lang.String, com.codename1.ui.URLImage.ImageAdapter)
except the URL is retrieved from the entity’s property, instead of as a parameter. |
Image |
createImageToFile(Tag tag,
EncodedImage placeholder,
String file,
URLImage.ImageAdapter adapter)
Creates an image for a given property to file system.This behaves similarly to the
URLImage.createToFileSystem(com.codename1.ui.EncodedImage, java.lang.String, java.lang.String, com.codename1.ui.URLImage.ImageAdapter)
except the URL is retrieved from the entity’s property, instead of as a parameter. |
Image |
createImageToFile(Tag tag,
EncodedImage placeholder,
URLImage.ImageAdapter adapter)
Creates an image for a given property to file system.
|
Image |
createImageToStorage(Property prop,
EncodedImage placeholder)
Creates an image to storage on the given property.
|
Image |
createImageToStorage(Property prop,
EncodedImage placeholder,
String storageFile)
Creates an image to storage on the given property.This behaves similarly to the
URLImage.createToStorage(com.codename1.ui.EncodedImage, java.lang.String, java.lang.String)
except the URL is retrieved from the entity’s property, instead of as a parameter. |
Image |
createImageToStorage(Property prop,
EncodedImage placeholder,
String storageFile,
URLImage.ImageAdapter adapter)
Creates an image to storage on the given property.This behaves similarly to the
URLImage.createToStorage(com.codename1.ui.EncodedImage, java.lang.String, java.lang.String)
except the URL is retrieved from the entity’s property, instead of as a parameter. |
Image |
createImageToStorage(Property prop,
EncodedImage placeholder,
URLImage.ImageAdapter adapter)
Creates an image to storage on the given property.
|
Image |
createImageToStorage(Tag tag,
EncodedImage placeholder)
Creates an image to storage on the given property.
|
Image |
createImageToStorage(Tag tag,
EncodedImage placeholder,
String storageFile)
Creates an image for a given property to storage.
|
Image |
createImageToStorage(Tag tag,
EncodedImage placeholder,
String storageFile,
URLImage.ImageAdapter adapter)
Creates an image for a given property to storage.This behaves similarly to the
URLImage.createToStorage(com.codename1.ui.EncodedImage, java.lang.String, java.lang.String)
except the URL is retrieved from the entity’s property, instead of as a parameter. |
Image |
createImageToStorage(Tag tag,
EncodedImage placeholder,
URLImage.ImageAdapter adapter)
Creates an image for a given property to storage.
|
Property |
findProperty(Tag... tags)
Finds the property corresponding to the given tags.
|
Object |
get(Object key)
Gets a property value.
|
<T> T |
get(Property<T> prop)
Gets the value of the specified property.
|
<V> V |
get(Property prop,
ContentType<V> contentType)
Gets property value as given content type.
|
Aggregate |
getAggregate()
Gets the aggregate that this entity is a part of, or creates a new Aggregate with this entity as a its root.
|
<T> T |
getAs(Property prop,
Class<T> cls) |
<T> boolean |
getAs(Property prop,
Class<T> cls,
SuccessCallback<T> callback) |
<T> T |
getAs(Tag tag,
Class<T> cls) |
<T> boolean |
getAs(Tag tag,
Class<T> cls,
SuccessCallback<T> callback) |
Boolean |
getBoolean(Property prop)
Gets property value as Boolean.
|
Boolean |
getBoolean(Tag... tags)
Gets property value as Boolean.
|
Date |
getDate(Property prop)
Gets property as date
|
Date |
getDate(Tag... tags)
Gets property as date.
|
Double |
getDouble(Property prop)
Gets a property value as a Double.
|
Double |
getDouble(Tag... tags)
Gets property value as a Double.
|
BaseEntity |
getEntity() |
Entity |
getEntity(Property prop)
Gets the a property value as an Entity.
|
Entity |
getEntity(Tag... tag)
Gets the a property as an Entity.
|
EntityList |
getEntityList(Property prop)
Gets property as an EntityList
|
EntityList |
getEntityList(Tag... tag)
Gets a property as an EntityList.
|
EntityList |
getEntityListNonNull(Property prop)
Gets property as an EntityList.
|
Entity |
getEntityNonNull(Property prop)
Gets a property value as an Entity.
|
EntityType |
getEntityType()
Gets the entity type of this entity.
|
Integer |
getInt(Property prop)
Gets property value as Integer
|
Integer |
getInt(Tag... tags)
Gets property value as an Integer.
|
Long |
getLong(Property prop)
Gets property value as Long
|
Long |
getLong(Tag... tags)
Gets property value as a Long.
|
String |
getText(Property prop)
Gets a property as text.
|
String |
getText(Tag... tags)
Gets a property value as text.
|
boolean |
hasPropertyChangeListeners(Property prop) |
boolean |
hasVetoablePropertyChangeListeners(Property prop) |
boolean |
isEmpty(Property prop)
Checks if property is empty.
|
boolean |
isEmpty(Tag tag)
Checks if property is empty.
|
boolean |
isEntity(Property prop)
Checks if property is an Entity.
|
boolean |
isEntity(Tag tag)
Checks if property is an entity.
|
boolean |
isFalsey(Property prop)
Checks if property value is falsey.
|
boolean |
isFalsey(Tag tag)
Checks if property value is falsey.
|
void |
removePropertyChangeListener(ActionListener<PropertyChangeEvent> l)
Removes property change listener.
|
void |
removePropertyChangeListener(Property property,
ActionListener<PropertyChangeEvent> l)
Removes a property change listener.
|
void |
removeVetoablePropertyChangeListener(ActionListener<VetoablePropertyChangeEvent> l)
Removes property change listener.
|
void |
removeVetoablePropertyChangeListener(Property property,
ActionListener<VetoablePropertyChangeEvent> l)
Removes a property change listener.
|
boolean |
set(ContentType inputType,
Object val,
Tag... tags)
Sets the property value as the given content type.
|
void |
set(Object key,
Object value)
Sets a property value.
|
void |
set(Property prop,
ContentType inputType,
Object val)
Sets property as given content type.
|
boolean |
set(Tag tag,
ContentType inputType,
Object val)
Sets the property value as the given content type.
|
boolean |
setBoolean(boolean val,
Tag... tags)
Sets property as boolean.
|
void |
setBoolean(Property prop,
boolean val)
Sets property as boolean
|
boolean |
setBoolean(Tag tag,
boolean val)
Sets property as boolean.
|
void |
setChanged(Property prop,
boolean firePropertyChange)
Marks a property value as "changed".
|
boolean |
setDate(Date date,
Tag... tags)
Sets property as Date.
|
void |
setDate(Property prop,
Date date)
Sets property as Date
|
boolean |
setDate(Tag tag,
Date date)
Sets property as Date.
|
boolean |
setDouble(double val,
Tag... tags)
Sets property as double.
|
void |
setDouble(Property prop,
double val)
Sets property as Double
|
boolean |
setDouble(Tag tag,
double val)
Sets property as double.
|
boolean |
setEntity(Entity e,
Tag... tags)
Sets property as Entity.
|
void |
setEntity(Property prop,
Entity e)
Sets property as Entity
|
boolean |
setEntity(Tag tag,
Entity e)
Sets property as Entity.
|
void |
setEntityType(EntityType entityType)
Sets the entity type for this entity.
|
boolean |
setFloat(float val,
Tag... tags)
Sets property as float.
|
void |
setFloat(Property prop,
float val)
Sets property as Float
|
boolean |
setFloat(Tag tag,
float val)
Sets property as float.
|
boolean |
setInt(int val,
Tag... tags)
Sets property as int.
|
void |
setInt(Property prop,
int val)
Sets property as int
|
boolean |
setInt(Tag tag,
int val)
Sets property as int.
|
boolean |
setLong(long val,
Tag... tags)
Sets property as long.
|
void |
setLong(Property prop,
long val)
Sets property as Long
|
boolean |
setLong(Tag tag,
long val)
Sets property as long.
|
void |
setText(Property prop,
String text) |
boolean |
setText(String text,
Tag... tags)
Sets property as text
|
boolean |
setText(Tag tag,
String text)
Sets the given property as text.
|
Map |
toMap(Object... keys)
Converts the entity to a Map.
|
String |
toString() |
protected final Entity entity
protected SimpleEntityWrapper(Entity entity)
public BaseEntity getEntity()
getEntity in interface EntitygetEntity in interface EntityWrapperpublic void add(Property prop, Entity value)
EntityAdds an item to the given property. Assumes that the property value is an EntityList. If property is currently null, it will attempt to create an EntityList for the property, and add a value.
public void addPropertyChangeListener(Property property, ActionListener<PropertyChangeEvent> l)
EntityAdds a listener to be notified of changes to the given property.
addPropertyChangeListener in interface Entityproperty - The property to listen on.l - The listener.public void addPropertyChangeListener(ActionListener<PropertyChangeEvent> l)
EntityAdds a listener to listen to all property changes on all properties.
addPropertyChangeListener in interface Entityl - The listener.public void addVetoablePropertyChangeListener(Property property, ActionListener<VetoablePropertyChangeEvent> l)
EntityAdds a listener to be notified of changes to the given property.
addVetoablePropertyChangeListener in interface Entityproperty - The property to listen on.l - The listener.public void addVetoablePropertyChangeListener(ActionListener<VetoablePropertyChangeEvent> l)
EntityAdds a listener to listen to all property changes on all properties.
addVetoablePropertyChangeListener in interface Entityl - The listener.public <T> boolean as(Class<T> cls, SuccessCallback<T> callback)
public Image createImageToFile(Tag tag, EncodedImage placeholder, URLImage.ImageAdapter adapter)
EntityCreates an image for a given property to file system. This behaves similarly to the URLImage.createToFileSystem(com.codename1.ui.EncodedImage, java.lang.String, java.lang.String, com.codename1.ui.URLImage.ImageAdapter)
except the URL is retrieved from the entity’s property, instead of as a parameter.
createImageToFile in interface Entitytag - The tag used to look up the property to store.placeholder - The placeholder image.adapter - Adapter to manipulate the image when loading.public Image createImageToFile(Property prop, EncodedImage placeholder, URLImage.ImageAdapter adapter)
EntityCreates an image for a given property to file system. This behaves similarly to the URLImage.createToFileSystem(com.codename1.ui.EncodedImage, java.lang.String, java.lang.String, com.codename1.ui.URLImage.ImageAdapter)
except the URL is retrieved from the entity’s property, instead of as a parameter.
createImageToFile in interface Entityprop - The property where the image url should be retrieved from.placeholder - The placeholder image.adapter - Adapter to manipulate the image when loading.public Image createImageToFile(Tag tag, EncodedImage placeholder)
EntityCreates an image for a given property to file system. This behaves similarly to the URLImage.createToFileSystem(com.codename1.ui.EncodedImage, java.lang.String, java.lang.String, com.codename1.ui.URLImage.ImageAdapter)
except the URL is retrieved from the entity’s property, instead of as a parameter.
createImageToFile in interface Entitytag - The tag used to look up the property to store.placeholder - The placeholder image.public Image createImageToFile(Property prop, EncodedImage placeholder)
EntityCreates an image for a given property to file system. This behaves similarly to the URLImage.createToFileSystem(com.codename1.ui.EncodedImage, java.lang.String, java.lang.String, com.codename1.ui.URLImage.ImageAdapter)
except the URL is retrieved from the entity’s property, instead of as a parameter.
createImageToFile in interface Entityprop - The property where the image url should be retrieved from.placeholder - The placeholder image.public Image createImageToFile(Tag tag, EncodedImage placeholder, String file)
EntityCreates an image for a given property to file system.This behaves similarly to the URLImage.createToFileSystem(com.codename1.ui.EncodedImage, java.lang.String, java.lang.String, com.codename1.ui.URLImage.ImageAdapter)
except the URL is retrieved from the entity’s property, instead of as a parameter.
createImageToFile in interface Entitytag - The tag used to look up the property to store.placeholder - The placeholder image.file - The path where to cache the image in the file system.public Image createImageToFile(Property prop, EncodedImage placeholder, String file)
EntityCreates an image for a given property to file system.This behaves similarly to the URLImage.createToFileSystem(com.codename1.ui.EncodedImage, java.lang.String, java.lang.String, com.codename1.ui.URLImage.ImageAdapter)
except the URL is retrieved from the entity’s property, instead of as a parameter.
createImageToFile in interface Entityprop - The property where the image URL should be retrieved from.placeholder - The placeholder image.file - The path where to cache the image in the file system.public Image createImageToFile(Tag tag, EncodedImage placeholder, String file, URLImage.ImageAdapter adapter)
EntityCreates an image for a given property to file system.This behaves similarly to the URLImage.createToFileSystem(com.codename1.ui.EncodedImage, java.lang.String, java.lang.String, com.codename1.ui.URLImage.ImageAdapter)
except the URL is retrieved from the entity’s property, instead of as a parameter.
createImageToFile in interface Entitytag - The tag used to look up the property to store.placeholder - The placeholder image.file - The path where to cache the image in the file system.adapter - Adapter to manipulate the image on load.public Image createImageToFile(Property prop, EncodedImage placeholder, String file, URLImage.ImageAdapter adapter)
EntityCreates an image for a given property to file system.This behaves similarly to the URLImage.createToFileSystem(com.codename1.ui.EncodedImage, java.lang.String, java.lang.String, com.codename1.ui.URLImage.ImageAdapter)
except the URL is retrieved from the entity’s property, instead of as a parameter.
createImageToFile in interface Entityprop - The property where the image URL should be retrieved from.placeholder - The placeholder image.file - The path where to cache the image in the file system.adapter - Adapter to manipulate the image on load.public Image createImageToStorage(Tag tag, EncodedImage placeholder, URLImage.ImageAdapter adapter)
EntityCreates an image for a given property to storage. This behaves similarly to the URLImage.createToStorage(com.codename1.ui.EncodedImage, java.lang.String, java.lang.String)
except the URL is retrieved from the entity’s property, instead of as a parameter.
createImageToStorage in interface Entitytag - The tag used to look up the property to store.placeholder - The placeholder image.adapter - Adapter for manipulating the image.URLImage.createToStorage(com.codename1.ui.EncodedImage, java.lang.String, java.lang.String)public Image createImageToStorage(Property prop, EncodedImage placeholder, URLImage.ImageAdapter adapter)
EntityCreates an image to storage on the given property. This behaves similarly to the URLImage.createToStorage(com.codename1.ui.EncodedImage, java.lang.String, java.lang.String)
except the URL is retrieved from the entity’s property, instead of as a parameter.
createImageToStorage in interface Entityprop - The property to store the image in.placeholder - The placeholder image.public Image createImageToStorage(Tag tag, EncodedImage placeholder)
EntityCreates an image to storage on the given property. This behaves similarly to the URLImage.createToStorage(com.codename1.ui.EncodedImage, java.lang.String, java.lang.String)
except the URL is retrieved from the entity’s property, instead of as a parameter.
createImageToStorage in interface Entitytag - The tag used to look up the property to store.placeholder - The placeholder image.public Image createImageToStorage(Property prop, EncodedImage placeholder)
EntityCreates an image to storage on the given property. This behaves similarly to the URLImage.createToStorage(com.codename1.ui.EncodedImage, java.lang.String, java.lang.String)
except the URL is retrieved from the entity’s property, instead of as a parameter.
createImageToStorage in interface Entityprop - The property to store the image in.placeholder - The placeholder image.public Image createImageToStorage(Tag tag, EncodedImage placeholder, String storageFile)
EntityCreates an image for a given property to storage. This behaves similarly to the URLImage.createToStorage(com.codename1.ui.EncodedImage, java.lang.String, java.lang.String)
except the URL is retrieved from the entity’s property, instead of as a parameter.
createImageToStorage in interface Entitytag - The tag used to look up the property to store.placeholder - The placeholder image.storageFile - The storage key to store the image in.URLImage.createToStorage(com.codename1.ui.EncodedImage, java.lang.String, java.lang.String)public Image createImageToStorage(Property prop, EncodedImage placeholder, String storageFile)
EntityCreates an image to storage on the given property.This behaves similarly to the URLImage.createToStorage(com.codename1.ui.EncodedImage, java.lang.String, java.lang.String)
except the URL is retrieved from the entity’s property, instead of as a parameter.
createImageToStorage in interface Entityprop - The property to store the image in.placeholder - The placeholder image.storageFile - The storage key where the image should be cached.public Image createImageToStorage(Tag tag, EncodedImage placeholder, String storageFile, URLImage.ImageAdapter adapter)
EntityCreates an image for a given property to storage.This behaves similarly to the URLImage.createToStorage(com.codename1.ui.EncodedImage, java.lang.String, java.lang.String)
except the URL is retrieved from the entity’s property, instead of as a parameter.
createImageToStorage in interface Entitytag - The tag used to look up the property to store.placeholder - The placeholder image.storageFile - The storage key to store the image in.adapter - Adapter to manipulate the image when loading.URLImage.createToStorage(com.codename1.ui.EncodedImage, java.lang.String, java.lang.String)public Image createImageToStorage(Property prop, EncodedImage placeholder, String storageFile, URLImage.ImageAdapter adapter)
EntityCreates an image to storage on the given property.This behaves similarly to the URLImage.createToStorage(com.codename1.ui.EncodedImage, java.lang.String, java.lang.String)
except the URL is retrieved from the entity’s property, instead of as a parameter.
createImageToStorage in interface Entityprop - The property to store the image in.placeholder - The placeholder image.storageFile - The storage key where the image should be cached.adapter - Adapter to manipulate the image when loading.public Property findProperty(Tag... tags)
EntityFinds the property corresponding to the given tags.
findProperty in interface Entitytags - The tags to search for. The first tag resolving to a property is used.public <T> T get(Property<T> prop)
EntityGets the value of the specified property.
public <V> V get(Property prop, ContentType<V> contentType)
EntityGets property value as given content type.
public Aggregate getAggregate()
EntityGets the aggregate that this entity is a part of, or creates a new Aggregate with this entity as a its root.
getAggregate in interface Entitypublic <T> boolean getAs(Property prop, Class<T> cls, SuccessCallback<T> callback)
public <T> boolean getAs(Tag tag, Class<T> cls, SuccessCallback<T> callback)
public Boolean getBoolean(Property prop)
EntityGets property value as Boolean. Consider using Entity.isFalsey(com.codename1.rad.models.Property) instead
of this method if it is possible that the property is null, or stores a type other than Boolean.
getBoolean in interface Entityprop - The property.public Boolean getBoolean(Tag... tags)
EntityGets property value as Boolean. Consider using Entity.isFalsey(com.codename1.rad.models.Tag) instead
of this method if it is possible that the property is null, or stores a type other than Boolean.
getBoolean in interface Entitytags - Tags to search for. First tag resolving to a property is used.public Date getDate(Property prop)
EntityGets property as date
public Date getDate(Tag... tags)
EntityGets property as date.
public Double getDouble(Property prop)
EntityGets a property value as a Double.
public Double getDouble(Tag... tags)
EntityGets property value as a Double.
public Entity getEntity(Tag... tag)
EntityGets the a property as an Entity.
public Entity getEntity(Property prop)
EntityGets the a property value as an Entity.
public EntityList getEntityList(Tag... tag)
EntityGets a property as an EntityList.
getEntityList in interface Entitytag - The tag used to look up the property. More than one tag can be supplied. The first matching
tag (i.e. for which the entity has a corresponding property) will be used.public EntityList getEntityList(Property prop)
EntityGets property as an EntityList
getEntityList in interface Entityprop - The property to retrieve.public EntityList getEntityListNonNull(Property prop)
EntityGets property as an EntityList. If the property is currently null, then this will attempt to create a new EntityList at this property, and return that.
getEntityListNonNull in interface Entityprop - The property.public Entity getEntityNonNull(Property prop)
EntityGets a property value as an Entity. If the property value is currently null, then this will attempt to create a new Entity at this property, and return that.
getEntityNonNull in interface Entityprop - The property to get.public EntityType getEntityType()
EntityGets the entity type of this entity.
getEntityType in interface Entitypublic Integer getInt(Property prop)
EntityGets property value as Integer
public Integer getInt(Tag... tags)
EntityGets property value as an Integer.
public Long getLong(Property prop)
EntityGets property value as Long
public Long getLong(Tag... tags)
EntityGets property value as a Long.
public String getText(Property prop)
EntityGets a property as text.
public String getText(Tag... tags)
EntityGets a property value as text.
public boolean hasPropertyChangeListeners(Property prop)
hasPropertyChangeListeners in interface Entitypublic boolean hasVetoablePropertyChangeListeners(Property prop)
hasVetoablePropertyChangeListeners in interface Entitypublic boolean isEmpty(Property prop)
EntityChecks if property is empty. This includes if property is null, an empty string, or an EntityList that is empty.
public boolean isEmpty(Tag tag)
EntityChecks if property is empty. This includes if property is null, an empty string, or an EntityList that is empty.
public boolean isEntity(Property prop)
EntityChecks if property is an Entity.
public boolean isEntity(Tag tag)
EntityChecks if property is an entity.
public boolean isFalsey(Property prop)
EntityChecks if property value is falsey. This includes if the entity doesn’t contain the property, if the property value is null,
or an empty string, or a boolean false value, is numeric with a 0 value, or is an empty EntityList.
public boolean isFalsey(Tag tag)
EntityChecks if property value is falsey. This includes if the entity doesn’t contain the property, if the property value is null,
or an empty string, or a boolean false value, is numeric with a 0 value, or is an empty EntityList.
public void removePropertyChangeListener(Property property, ActionListener<PropertyChangeEvent> l)
EntityRemoves a property change listener.
removePropertyChangeListener in interface Entityproperty - The property to listen to.l - The listener.public void removePropertyChangeListener(ActionListener<PropertyChangeEvent> l)
EntityRemoves property change listener.
removePropertyChangeListener in interface Entityl - The listener.public void removeVetoablePropertyChangeListener(Property property, ActionListener<VetoablePropertyChangeEvent> l)
EntityRemoves a property change listener.
removeVetoablePropertyChangeListener in interface Entityproperty - The property to listen to.l - The listener.public void removeVetoablePropertyChangeListener(ActionListener<VetoablePropertyChangeEvent> l)
EntityRemoves property change listener.
removeVetoablePropertyChangeListener in interface Entityl - The listener.public void set(Object key, Object value)
EntitySets a property value.
public void set(Property prop, ContentType inputType, Object val)
EntitySets property as given content type.
public boolean set(Tag tag, ContentType inputType, Object val)
EntitySets the property value as the given content type.
public boolean set(ContentType inputType, Object val, Tag... tags)
EntitySets the property value as the given content type.
set in interface EntityinputType - The content type of the input data.val - The value to set.tags - The tags used to lookup the property. The first tag resolving to a property is used.public void setBoolean(Property prop, boolean val)
EntitySets property as boolean
setBoolean in interface Entityprop - The property to setval - The value to set.public boolean setBoolean(Tag tag, boolean val)
EntitySets property as boolean.
setBoolean in interface Entitytag - Tag used to lookup property.val - The value to set.public boolean setBoolean(boolean val,
Tag... tags)
EntitySets property as boolean.
setBoolean in interface Entityval - The value to set.tags - Tags used to lookup property.public void setChanged(Property prop, boolean firePropertyChange)
EntityMarks a property value as "changed". This will propagate a call to #setChanged()
(marking the whole object as changed), and it will fire a property change event, if the firePropertyChange argument
is true.
setChanged in interface Entityprop - The property to mark as changed.firePropertyChange - True to fire a property change event to all listeners of this property.public void setDate(Property prop, Date date)
EntitySets property as Date
public boolean setDate(Tag tag, Date date)
EntitySets property as Date.
public boolean setDate(Date date, Tag... tags)
EntitySets property as Date.
public void setDouble(Property prop, double val)
EntitySets property as Double
public boolean setDouble(Tag tag, double val)
EntitySets property as double.
public boolean setDouble(double val,
Tag... tags)
EntitySets property as double.
public void setEntity(Property prop, Entity e)
EntitySets property as Entity
public boolean setEntity(Tag tag, Entity e)
EntitySets property as Entity.
public boolean setEntity(Entity e, Tag... tags)
EntitySets property as Entity.
public void setEntityType(EntityType entityType)
EntitySets the entity type for this entity. The general pattern for entity definitions is to call this either in the constructor, or in the instance INIT section, AFTER defining the Entity Type.
E.g.
public class Person extends Entity {
public static final EntityType TYPE = new EntityType() {{
string(Thing.name);
string(Thing.description);
}};
{
setEntityType(TYPE);
}
}
setEntityType in interface Entitypublic void setFloat(Property prop, float val)
EntitySets property as Float
public boolean setFloat(Tag tag, float val)
EntitySets property as float.
public boolean setFloat(float val,
Tag... tags)
EntitySets property as float.
public void setInt(Property prop, int val)
EntitySets property as int
public boolean setInt(Tag tag, int val)
EntitySets property as int.
public boolean setInt(int val,
Tag... tags)
EntitySets property as int.
public void setLong(Property prop, long val)
EntitySets property as Long
public boolean setLong(Tag tag, long val)
EntitySets property as long.
public boolean setLong(long val,
Tag... tags)
EntitySets property as long.
public boolean setText(Tag tag, String text)
EntitySets the given property as text.
public boolean setText(String text, Tag... tags)
EntitySets property as text
public Map toMap(Object... keys)
EntityConverts the entity to a Map. This will return a Map whose keys correspond to the keys supplied, and values are the correponding value in the entity.
Copyright © 2021. All Rights Reserved.