@Api(allMethods=true) public class AssociationValue extends Object implements Serializable
Definition of a value for association attributes. The ManyToOneAttribute will contain one of these, while the
OneToManyAttribute will contain a whole list of these values.
It basically defines the bean that holds the attribute value. These beans all have an identifier and a list of attributes themselves, so that is represented in the value object.
| Constructor and Description |
|---|
AssociationValue()
Constructor, create attribute without value (needed for GWT).
|
AssociationValue(PrimitiveAttribute<?> id,
Map<String,Attribute<?>> attributes,
boolean primitiveOnly)
Create attribute with specified value and optionally restrict attribute values to primitives.
|
AssociationValue(PrimitiveAttribute<?> id,
Map<String,PrimitiveAttribute<?>> attributes)
Create attribute with specified value and primitive attributes only.
|
| Modifier and Type | Method and Description |
|---|---|
Object |
clone()
Create a clone of this object.
|
Map<String,Attribute<?>> |
getAllAttributes()
Get the attributes for the associated object.
|
Map<String,PrimitiveAttribute<?>> |
getAttributes()
Deprecated.
replaced by
getAllAttributes() after introduction of nested associations |
Object |
getAttributeValue(String attributeName)
Convenience method that returns the attribute value for the specified attribute name.
|
PrimitiveAttribute<?> |
getId()
Get the id for the associated object.
|
boolean |
isPrimitiveOnly()
Returns whether this value can only contain primitive attributes.
|
void |
setAllAttributes(Map<String,Attribute<?>> attributes)
Set the attributes for the associated object.
|
void |
setAttributes(Map<String,PrimitiveAttribute<?>> attributes)
Deprecated.
replaced by
setAllAttributes(Map) after introduction of nested associations |
void |
setBooleanAttribute(String name,
Boolean value)
Sets the specified boolean attribute to the specified value.
|
void |
setCurrencyAttribute(String name,
String value)
Sets the specified currency attribute to the specified value.
|
void |
setDateAttribute(String name,
Date value)
Sets the specified date attribute to the specified value.
|
void |
setDoubleAttribute(String name,
Double value)
Sets the specified double attribute to the specified value.
|
void |
setFloatAttribute(String name,
Float value)
Sets the specified float attribute to the specified value.
|
void |
setId(PrimitiveAttribute<?> id)
Set the id for the associated object.
|
void |
setImageUrlAttribute(String name,
String value)
Sets the specified image URL attribute to the specified value.
|
void |
setIntegerAttribute(String name,
Integer value)
Sets the specified integer attribute to the specified value.
|
void |
setLongAttribute(String name,
Long value)
Sets the specified long attribute to the specified value.
|
void |
setManyToOneAttribute(String name,
AssociationValue value)
Sets the specified many-to-one attribute to the specified value.
|
void |
setPrimitiveOnly(boolean primitiveOnly)
Specify whether this value can only contain primitive attributes.
|
void |
setShortAttribute(String name,
Short value)
Sets the specified short attribute to the specified value.
|
void |
setStringAttribute(String name,
String value)
Sets the specified string attribute to the specified value.
|
void |
setUrlAttribute(String name,
String value)
Sets the specified URL attribute to the specified value.
|
String |
toString()
Returns a string representation of the value of the form
{id=1, attr1=a, attr2=0.5}. |
public AssociationValue()
public AssociationValue(PrimitiveAttribute<?> id, Map<String,PrimitiveAttribute<?>> attributes)
id - id attribute for associationattributes - values for the attributespublic AssociationValue(PrimitiveAttribute<?> id, Map<String,Attribute<?>> attributes, boolean primitiveOnly)
id - id attribute for associationattributes - values for the attributesprimitiveOnly - true if only primitive attributes should be allowed, false otherwisepublic Object clone()
public PrimitiveAttribute<?> getId()
public void setId(PrimitiveAttribute<?> id)
id - id for associated object@Deprecated public Map<String,PrimitiveAttribute<?>> getAttributes()
getAllAttributes() after introduction of nested associations@Deprecated public void setAttributes(Map<String,PrimitiveAttribute<?>> attributes)
setAllAttributes(Map) after introduction of nested associationsattributes - attributes for associated objectspublic Map<String,Attribute<?>> getAllAttributes()
public void setAllAttributes(Map<String,Attribute<?>> attributes)
attributes - attributes for associated objectspublic Object getAttributeValue(String attributeName)
attributeName - the name of the attributepublic boolean isPrimitiveOnly()
public void setPrimitiveOnly(boolean primitiveOnly)
primitiveOnly - true if only primitive attributes, false otherwisepublic void setBooleanAttribute(String name, Boolean value)
name - name of the attributevalue - value of the attributepublic void setCurrencyAttribute(String name, String value)
name - name of the attributevalue - value of the attributepublic void setDateAttribute(String name, Date value)
name - name of the attributevalue - value of the attributepublic void setDoubleAttribute(String name, Double value)
name - name of the attributevalue - value of the attributepublic void setFloatAttribute(String name, Float value)
name - name of the attributevalue - value of the attributepublic void setImageUrlAttribute(String name, String value)
name - name of the attributevalue - value of the attributepublic void setIntegerAttribute(String name, Integer value)
name - name of the attributevalue - value of the attributepublic void setLongAttribute(String name, Long value)
name - name of the attributevalue - value of the attributepublic void setShortAttribute(String name, Short value)
name - name of the attributevalue - value of the attributepublic void setStringAttribute(String name, String value)
name - name of the attributevalue - value of the attributepublic void setUrlAttribute(String name, String value)
name - name of the attributevalue - value of the attributepublic void setManyToOneAttribute(String name, AssociationValue value)
name - name of the attributevalue - value of the attributeCopyright © 2015 Geosparc. All Rights Reserved.