@SuppressWarnings("unchecked") private static <C extends UIComponent> List<C> getMetadataChildren(UIViewRoot root, Class<C> type) { return (List<C>) getMetadataFacet(root).map(m -> m.getChildren()).orElseGet(Collections::emptyList) .stream().filter(c -> type.isInstance(c)).collect(Collectors.toList()); }
@SuppressWarnings("unchecked") private static <C extends UIComponent> List<C> getMetadataChildren(UIViewRoot root, Class<C> type) { return (List<C>) getMetadataFacet(root).map(m -> m.getChildren()).orElseGet(Collections::emptyList) .stream().filter(c -> type.isInstance(c)).collect(Collectors.toList()); }
@SuppressWarnings("unchecked") private static <C extends UIComponent> List<C> getMetadataChildren(UIViewRoot root, Class<C> type) { return (List<C>) getMetadataFacet(root).map(m -> m.getChildren()).orElseGet(Collections::emptyList) .stream().filter(c -> type.isInstance(c)).collect(Collectors.toList()); }
@SuppressWarnings("unchecked") private static <C extends UIComponent> List<C> getMetadataChildren(UIViewRoot root, Class<C> type) { return (List<C>) getMetadataFacet(root).map(m -> m.getChildren()).orElseGet(Collections::emptyList) .stream().filter(c -> type.isInstance(c)).collect(Collectors.toList()); }
@SuppressWarnings("unchecked") private static <C extends UIComponent> List<C> getMetadataChildren(UIViewRoot root, Class<C> type) { return (List<C>) getMetadataFacet(root).map(m -> m.getChildren()).orElseGet(Collections::emptyList) .stream().filter(c -> type.isInstance(c)).collect(Collectors.toList()); }
@SuppressWarnings("unchecked") private static <C extends UIComponent> List<C> getMetadataChildren(UIViewRoot root, Class<C> type) { return (List<C>) getMetadataFacet(root).map(m -> m.getChildren()).orElseGet(Collections::emptyList) .stream().filter(c -> type.isInstance(c)).collect(Collectors.toList()); }
@SuppressWarnings("unchecked") private static <C extends UIComponent> List<C> getMetadataChildren(UIViewRoot root, Class<C> type) { return (List<C>) getMetadataFacet(root).map(m -> m.getChildren()).orElseGet(Collections::emptyList) .stream().filter(c -> type.isInstance(c)).collect(Collectors.toList()); }
/** * <p class="changed_added_2_2">Utility method to determine if the * the provided {@link UIViewRoot} has metadata. The default implementation will * return true if the provided {@code UIViewRoot} has a facet * named {@link UIViewRoot#METADATA_FACET_NAME} and that facet has children. * It will return false otherwise.</p> * * @param root the {@link UIViewRoot} from which the metadata will * be extracted from * * @return true if the view has metadata, false otherwise. */ public static boolean hasMetadata(UIViewRoot root) { return getMetadataFacet(root).map(m -> m.getChildCount() > 0).orElse(false); }
/** * <p class="changed_added_2_2">Utility method to determine if the * the provided {@link UIViewRoot} has metadata. The default implementation will * return true if the provided {@code UIViewRoot} has a facet * named {@link UIViewRoot#METADATA_FACET_NAME} and that facet has children. * It will return false otherwise.</p> * * @param root the {@link UIViewRoot} from which the metadata will * be extracted from * * @return true if the view has metadata, false otherwise. */ public static boolean hasMetadata(UIViewRoot root) { return getMetadataFacet(root).map(m -> m.getChildCount() > 0).orElse(false); }
/** * <p class="changed_added_2_2">Utility method to determine if the * the provided {@link UIViewRoot} has metadata. The default implementation will * return true if the provided {@code UIViewRoot} has a facet * named {@link UIViewRoot#METADATA_FACET_NAME} and that facet has children. * It will return false otherwise.</p> * * @param root the {@link UIViewRoot} from which the metadata will * be extracted from * * @return true if the view has metadata, false otherwise. */ public static boolean hasMetadata(UIViewRoot root) { return getMetadataFacet(root).map(m -> m.getChildCount() > 0).orElse(false); }
/** * <p class="changed_added_2_2">Utility method to determine if the * the provided {@link UIViewRoot} has metadata. The default implementation will * return true if the provided {@code UIViewRoot} has a facet * named {@link UIViewRoot#METADATA_FACET_NAME} and that facet has children. * It will return false otherwise.</p> * * @param root the {@link UIViewRoot} from which the metadata will * be extracted from * * @return true if the view has metadata, false otherwise. */ public static boolean hasMetadata(UIViewRoot root) { return getMetadataFacet(root).map(m -> m.getChildCount() > 0).orElse(false); }
/** * <p class="changed_added_2_2">Utility method to determine if the * the provided {@link UIViewRoot} has metadata. The default implementation will * return true if the provided {@code UIViewRoot} has a facet * named {@link UIViewRoot#METADATA_FACET_NAME} and that facet has children. * It will return false otherwise.</p> * * @param root the {@link UIViewRoot} from which the metadata will * be extracted from * * @return true if the view has metadata, false otherwise. */ public static boolean hasMetadata(UIViewRoot root) { return getMetadataFacet(root).map(m -> m.getChildCount() > 0).orElse(false); }
/** * <p class="changed_added_2_2">Utility method to determine if the * the provided {@link UIViewRoot} has metadata. The default implementation will * return true if the provided {@code UIViewRoot} has a facet * named {@link UIViewRoot#METADATA_FACET_NAME} and that facet has children. * It will return false otherwise.</p> * * @param root the {@link UIViewRoot} from which the metadata will * be extracted from * * @return true if the view has metadata, false otherwise. */ public static boolean hasMetadata(UIViewRoot root) { return getMetadataFacet(root).map(m -> m.getChildCount() > 0).orElse(false); }
/** * <p class="changed_added_2_2">Utility method to determine if the * the provided {@link UIViewRoot} has metadata. The default implementation will * return true if the provided {@code UIViewRoot} has a facet * named {@link UIViewRoot#METADATA_FACET_NAME} and that facet has children. * It will return false otherwise.</p> * * @param root the {@link UIViewRoot} from which the metadata will * be extracted from * * @return true if the view has metadata, false otherwise. */ public static boolean hasMetadata(UIViewRoot root) { return getMetadataFacet(root).map(m -> m.getChildCount() > 0).orElse(false); }