@Override @Nonnull protected Node copyNode (final @Nonnull Node delegate) { return new FilteredNodePresentationModel(delegate, objectFilter, objectClass); }
/******************************************************************************************************************* * * ******************************************************************************************************************/ @Nonnull public final <T> T as (final @Nonnull Class<T> type) { return as(type, As.Defaults.throwAsException(type)); }
/******************************************************************************************************************* * * {@inheritDoc} * ******************************************************************************************************************/ @Nonnull public <T> T as (final @Nonnull Class<T> type, final @Nonnull NotFoundBehaviour<T> notFoundBehaviour) { final T result = getLookup().lookup(type); return (result != null) ? result : notFoundBehaviour.run(new NotFoundException(type.getName())); }
@Override @Nonnull public Node decorate (final @Nonnull Node node) { final ObjectFilter<GeoCoderEntity> objectFilter = new ObjectFilter<GeoCoderEntity>() { @Override public boolean accept (final @CheckForNull GeoCoderEntity geoEntity) { return (geoEntity == null) || geoEntity.as(LocalizedDisplayable).getDisplayName(Locale.ENGLISH).matches("^[AE].*"); } }; return new FilteredNodePresentationModel<GeoCoderEntity>(node, objectFilter, GeoCoderEntity.class); } }