public static final class Domain.StringProvider extends java.lang.Object implements Entity.ToString
Entity
instances.Entity
instance named entity containing the following mappings:
"key1" -> value1 "key2" -> value2 "key3" -> value3 "key4" -> {Entity instance with a single mapping "refKey" -> refValue}
Domain.StringProvider provider = new Domain.StringProvider();
provider.addText("key1=").addValue("key1").addText(", key3='").addValue("key3")
.addText("' foreign key value=").addForeignKeyValue("key4", "refKey");
System.out.println(provider.toString(entity));
key1=value1, key3='value3' foreign key value=refValue
Constructor and Description |
---|
StringProvider()
Instantiates a new
Domain.StringProvider instance |
StringProvider(java.lang.String propertyId)
Instantiates a new
Domain.StringProvider instance |
Modifier and Type | Method and Description |
---|---|
Domain.StringProvider |
addForeignKeyValue(java.lang.String foreignKeyPropertyId,
java.lang.String propertyId)
Adds the value mapped to the given property in the
Entity instance mapped to the given foreignKeyProperty
to this Domain.StringProvider |
Domain.StringProvider |
addFormattedValue(java.lang.String propertyId,
java.text.Format format)
Adds the value mapped to the given key to this StringProvider
|
Domain.StringProvider |
addText(java.lang.String text)
Adds the given static text to this
Domain.StringProvider |
Domain.StringProvider |
addValue(java.lang.String propertyId)
Adds the value mapped to the given key to this
Domain.StringProvider |
java.lang.String |
toString(Entity entity)
Returns a string representation of the given entity
|
public StringProvider()
Domain.StringProvider
instancepublic StringProvider(java.lang.String propertyId)
Domain.StringProvider
instancepropertyId
- the id of the property which value should be used for a string representationpublic java.lang.String toString(Entity entity)
toString
in interface Entity.ToString
entity
- the entitypublic Domain.StringProvider addValue(java.lang.String propertyId)
Domain.StringProvider
propertyId
- the id of the property which value should be added to the string representationDomain.StringProvider
instancepublic Domain.StringProvider addFormattedValue(java.lang.String propertyId, java.text.Format format)
propertyId
- the id of the property which value should be added to the string representationformat
- the Format to use when appending the valueDomain.StringProvider
instancepublic Domain.StringProvider addForeignKeyValue(java.lang.String foreignKeyPropertyId, java.lang.String propertyId)
Entity
instance mapped to the given foreignKeyProperty
to this Domain.StringProvider
foreignKeyPropertyId
- the if of the foreign key propertypropertyId
- the id of the property in the referenced entity to useDomain.StringProvider
instancepublic Domain.StringProvider addText(java.lang.String text)
Domain.StringProvider
text
- the text to addDomain.StringProvider
instance