public final <T> void addMappedObject(final String key, final T object, final BiConsumer<T, Arguments> mapper) { add(key, new TemplateObject.Mapped<>(object, mapper)); }
TemplateObject templateObject(final Arguments arguments) { TemplateObject object = arguments.get(propertyKey); if (object == null) { throw new IdCouldNotBeResolvedException(this.getFullId()); } if (nestedId == null) { return object; } if (!(object instanceof TemplateObject.Mapped)) { throw new IdCouldNotBeResolvedException(this.getFullId()); } try { Arguments mappedProperties = ((TemplateObject.Mapped) object).map(); return nestedId.templateObject(mappedProperties); } catch (IdCouldNotBeResolvedException e) { throw new IdCouldNotBeResolvedException(this.getFullId()); } }
TemplateObject templateObject(final Arguments arguments) { TemplateObject object = arguments.get(propertyKey); if (object == null) { throw new IdCouldNotBeResolvedException(this.getFullId()); } if (nestedId == null) { return object; } if (!(object instanceof TemplateObject.Mapped)) { throw new IdCouldNotBeResolvedException(this.getFullId()); } try { Arguments mappedProperties = ((TemplateObject.Mapped) object).map(); return nestedId.templateObject(mappedProperties); } catch (IdCouldNotBeResolvedException e) { throw new IdCouldNotBeResolvedException(this.getFullId()); } }
public final <T> void addMappedObject(final String key, final T object, final BiConsumer<T, Arguments> mapper) { add(key, new TemplateObject.Mapped<>(object, mapper)); }
Mapped(final T object, final BiConsumer<T, TemplateMap.Arguments> mapper) { super(mapper); this.object = object; this.mappedProperties = map(object); }
Mapped(final T object, final BiConsumer<T, TemplateMap.Arguments> mapper) { super(mapper); this.object = object; this.mappedProperties = map(object); }