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.
|
protected final Entity entity
protected SimpleEntityWrapper(Entity entity)
public BaseEntity getEntity()
getEntity
in interface Entity
getEntity
in interface EntityWrapper
public void add(Property prop, Entity value)
Entity
Adds 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)
Entity
Adds a listener to be notified of changes to the given property.
addPropertyChangeListener
in interface Entity
property
- The property to listen on.l
- The listener.public void addPropertyChangeListener(ActionListener<PropertyChangeEvent> l)
Entity
Adds a listener to listen to all property changes on all properties.
addPropertyChangeListener
in interface Entity
l
- The listener.public void addVetoablePropertyChangeListener(Property property, ActionListener<VetoablePropertyChangeEvent> l)
Entity
Adds a listener to be notified of changes to the given property.
addVetoablePropertyChangeListener
in interface Entity
property
- The property to listen on.l
- The listener.public void addVetoablePropertyChangeListener(ActionListener<VetoablePropertyChangeEvent> l)
Entity
Adds a listener to listen to all property changes on all properties.
addVetoablePropertyChangeListener
in interface Entity
l
- The listener.public <T> boolean as(Class<T> cls, SuccessCallback<T> callback)
public Image createImageToFile(Tag tag, EncodedImage placeholder, URLImage.ImageAdapter adapter)
Entity
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.
createImageToFile
in interface Entity
tag
- 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)
Entity
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.
createImageToFile
in interface Entity
prop
- 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)
Entity
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.
createImageToFile
in interface Entity
tag
- The tag used to look up the property to store.placeholder
- The placeholder image.public Image createImageToFile(Property prop, EncodedImage placeholder)
Entity
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.
createImageToFile
in interface Entity
prop
- The property where the image url should be retrieved from.placeholder
- The placeholder image.public Image createImageToFile(Tag tag, EncodedImage placeholder, String file)
Entity
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.
createImageToFile
in interface Entity
tag
- 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)
Entity
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.
createImageToFile
in interface Entity
prop
- 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)
Entity
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.
createImageToFile
in interface Entity
tag
- 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)
Entity
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.
createImageToFile
in interface Entity
prop
- 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)
Entity
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.
createImageToStorage
in interface Entity
tag
- 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)
Entity
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.
createImageToStorage
in interface Entity
prop
- The property to store the image in.placeholder
- The placeholder image.public Image createImageToStorage(Tag tag, EncodedImage placeholder)
Entity
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.
createImageToStorage
in interface Entity
tag
- The tag used to look up the property to store.placeholder
- The placeholder image.public Image createImageToStorage(Property prop, EncodedImage placeholder)
Entity
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.
createImageToStorage
in interface Entity
prop
- The property to store the image in.placeholder
- The placeholder image.public Image createImageToStorage(Tag tag, EncodedImage placeholder, String storageFile)
Entity
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.
createImageToStorage
in interface Entity
tag
- 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)
Entity
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.
createImageToStorage
in interface Entity
prop
- 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)
Entity
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.
createImageToStorage
in interface Entity
tag
- 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)
Entity
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.
createImageToStorage
in interface Entity
prop
- 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)
Entity
Finds the property corresponding to the given tags.
findProperty
in interface Entity
tags
- The tags to search for. The first tag resolving to a property is used.public <T> T get(Property<T> prop)
Entity
Gets the value of the specified property.
public <V> V get(Property prop, ContentType<V> contentType)
Entity
Gets property value as given content type.
public Aggregate getAggregate()
Entity
Gets the aggregate that this entity is a part of, or creates a new Aggregate with this entity as a its root.
getAggregate
in interface Entity
public <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)
Entity
Gets 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 Entity
prop
- The property.public Boolean getBoolean(Tag... tags)
Entity
Gets 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 Entity
tags
- Tags to search for. First tag resolving to a property is used.public Date getDate(Property prop)
Entity
Gets property as date
public Date getDate(Tag... tags)
Entity
Gets property as date.
public Double getDouble(Property prop)
Entity
Gets a property value as a Double.
public Double getDouble(Tag... tags)
Entity
Gets property value as a Double.
public Entity getEntity(Tag... tag)
Entity
Gets the a property as an Entity.
public Entity getEntity(Property prop)
Entity
Gets the a property value as an Entity.
public EntityList getEntityList(Tag... tag)
Entity
Gets a property as an EntityList.
getEntityList
in interface Entity
tag
- 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)
Entity
Gets property as an EntityList
getEntityList
in interface Entity
prop
- The property to retrieve.public EntityList getEntityListNonNull(Property prop)
Entity
Gets 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 Entity
prop
- The property.public Entity getEntityNonNull(Property prop)
Entity
Gets 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 Entity
prop
- The property to get.public EntityType getEntityType()
Entity
Gets the entity type of this entity.
getEntityType
in interface Entity
public Integer getInt(Property prop)
Entity
Gets property value as Integer
public Integer getInt(Tag... tags)
Entity
Gets property value as an Integer.
public Long getLong(Property prop)
Entity
Gets property value as Long
public Long getLong(Tag... tags)
Entity
Gets property value as a Long.
public String getText(Property prop)
Entity
Gets a property as text.
public String getText(Tag... tags)
Entity
Gets a property value as text.
public boolean hasPropertyChangeListeners(Property prop)
hasPropertyChangeListeners
in interface Entity
public boolean hasVetoablePropertyChangeListeners(Property prop)
hasVetoablePropertyChangeListeners
in interface Entity
public boolean isEmpty(Property prop)
Entity
Checks if property is empty. This includes if property is null, an empty string, or an EntityList that is empty.
public boolean isEmpty(Tag tag)
Entity
Checks if property is empty. This includes if property is null, an empty string, or an EntityList that is empty.
public boolean isEntity(Property prop)
Entity
Checks if property is an Entity.
public boolean isEntity(Tag tag)
Entity
Checks if property is an entity.
public boolean isFalsey(Property prop)
Entity
Checks 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)
Entity
Checks 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)
Entity
Removes a property change listener.
removePropertyChangeListener
in interface Entity
property
- The property to listen to.l
- The listener.public void removePropertyChangeListener(ActionListener<PropertyChangeEvent> l)
Entity
Removes property change listener.
removePropertyChangeListener
in interface Entity
l
- The listener.public void removeVetoablePropertyChangeListener(Property property, ActionListener<VetoablePropertyChangeEvent> l)
Entity
Removes a property change listener.
removeVetoablePropertyChangeListener
in interface Entity
property
- The property to listen to.l
- The listener.public void removeVetoablePropertyChangeListener(ActionListener<VetoablePropertyChangeEvent> l)
Entity
Removes property change listener.
removeVetoablePropertyChangeListener
in interface Entity
l
- The listener.public void set(Object key, Object value)
Entity
Sets a property value.
public void set(Property prop, ContentType inputType, Object val)
Entity
Sets property as given content type.
public boolean set(Tag tag, ContentType inputType, Object val)
Entity
Sets the property value as the given content type.
public boolean set(ContentType inputType, Object val, Tag... tags)
Entity
Sets the property value as the given content type.
set
in interface Entity
inputType
- 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)
Entity
Sets property as boolean
setBoolean
in interface Entity
prop
- The property to setval
- The value to set.public boolean setBoolean(Tag tag, boolean val)
Entity
Sets property as boolean.
setBoolean
in interface Entity
tag
- Tag used to lookup property.val
- The value to set.public boolean setBoolean(boolean val, Tag... tags)
Entity
Sets property as boolean.
setBoolean
in interface Entity
val
- The value to set.tags
- Tags used to lookup property.public void setChanged(Property prop, boolean firePropertyChange)
Entity
Marks 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 Entity
prop
- 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)
Entity
Sets property as Date
public boolean setDate(Tag tag, Date date)
Entity
Sets property as Date.
public boolean setDate(Date date, Tag... tags)
Entity
Sets property as Date.
public void setDouble(Property prop, double val)
Entity
Sets property as Double
public boolean setDouble(Tag tag, double val)
Entity
Sets property as double.
public boolean setDouble(double val, Tag... tags)
Entity
Sets property as double.
public void setEntity(Property prop, Entity e)
Entity
Sets property as Entity
public boolean setEntity(Tag tag, Entity e)
Entity
Sets property as Entity.
public boolean setEntity(Entity e, Tag... tags)
Entity
Sets property as Entity.
public void setEntityType(EntityType entityType)
Entity
Sets 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 Entity
public void setFloat(Property prop, float val)
Entity
Sets property as Float
public boolean setFloat(Tag tag, float val)
Entity
Sets property as float.
public boolean setFloat(float val, Tag... tags)
Entity
Sets property as float.
public void setInt(Property prop, int val)
Entity
Sets property as int
public boolean setInt(Tag tag, int val)
Entity
Sets property as int.
public boolean setInt(int val, Tag... tags)
Entity
Sets property as int.
public void setLong(Property prop, long val)
Entity
Sets property as Long
public boolean setLong(Tag tag, long val)
Entity
Sets property as long.
public boolean setLong(long val, Tag... tags)
Entity
Sets property as long.
public boolean setText(Tag tag, String text)
Entity
Sets the given property as text.
public boolean setText(String text, Tag... tags)
Entity
Sets property as text
Copyright © 2021. All Rights Reserved.