@Override
public <PK extends Serializable, T extends TimeableAttrRow<PK>, U extends EntityWithTimeableAttr<PK, T> & EntityWithConfigurableAttr>
Optional<IModel<String>> getStringAttribute(final U entity, final Date date, final String groupName, final String descName)
{
final T attrRowForCurrentDate = timeableService.getAttrRowValidAtDate(entity, groupName, date);
if (attrRowForCurrentDate == null) {
return Optional.empty();
}
final String attribute = attrRowForCurrentDate.getStringAttribute(descName);
if (attribute == null) {
return Optional.empty();
}
final AttrDescription attrDescription = getAttrDescription(entity, groupName, descName);
final IModel<String> valueModel = (attrDescription.getWicketComponentFactoryClass() instanceof DropDownAttrWicketComponentFactory) ?
new ResourceModel(attribute) :
new Model<>(attribute);
return Optional.of(valueModel);
}