Module is.codion.framework.domain
Interface EntityFormatter
- All Superinterfaces:
Function<Entity,,String> Serializable
Formats
Outputs the following String:
Entity instances into their string representations.
Instances are built via builder().
Entity track = connection.selectSingle(Track.NAME.equalTo("Come As You Are"));
EntityFormatter formatter = EntityFormatter.builder()
.text("Name=")
.value(Track.NAME)
.text(", Album='")
.value(Track.ALBUM_FK, Album.TITLE)
.text("'")
.build();
System.out.println(formatter.apply(track)); // Name=Come As You Are, Album='Nevermind'
Name=John, Department='Accounting'
given the entities above.
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic interfaceA Builder for a formatter, which provides toString() values for entities. -
Method Summary
Static Methods
-
Method Details
-
builder
- Returns:
- a
EntityFormatter.Builderinstance for configuring a formatterFunctionfor entities.
-