Code example for ImmutableMap.Builder

Methods: build, put

0
    protected LrsObject getLrsObject(PortalEvent event) {
        final String targetedLayoutNodeId = ((PortalRenderEvent)event).getTargetedLayoutNodeId();
        final AggregatedTabMapping aggregatedTabMapping = aggregatedTabLookupDao.getMappedTabForLayoutId(targetedLayoutNodeId);
 
        final Builder<String, LocalizedString> definitionBuilder = ImmutableMap.builder();
        definitionBuilder.put("name", new LocalizedString(Locale.US, aggregatedTabMapping.getDisplayString()));
 
        return new LrsObject(buildUrn("tab", aggregatedTabMapping.getFragmentName()),
                getDefaultObjectType(), 
                definitionBuilder.build());
    } 
}