@Test public void invalidJsonPassed() throws Exception { assertTrue( "An instance of " + ShowAllLinksVisibilityController.class.getSimpleName() + " should have been returned", QuickLinkVisibilityControllerFactory.get("Hello world!") instanceof ShowAllLinksVisibilityController); }
public static QuickLinkVisibilityController get(@Nullable String quickLinkProfileJson) { if (null == quickLinkProfileJson) { LOG.info("No quick link profile is set, will display all quicklinks."); return new ShowAllLinksVisibilityController(); } try { QuickLinksProfile profile = new QuickLinksProfileParser().parse(quickLinkProfileJson.getBytes()); return new DefaultQuickLinkVisibilityController(profile); } catch (IOException | QuickLinksProfileEvaluationException ex) { LOG.error("Unable to parse quick link profile json: " + quickLinkProfileJson, ex); return new ShowAllLinksVisibilityController(); } }
QuickLinkVisibilityControllerFactory { public static QuickLinkVisibilityController get(@Nullable String quickLinkProfileJson) { if (null == quickLinkProfileJson) { LOG.info("No quick link profile is set, will display all quicklinks."); return new ShowAllLinksVisibilityController(); } try { QuickLinksProfile profile = new QuickLinksProfileParser().parse(quickLinkProfileJson.getBytes()); return new DefaultQuickLinkVisibilityController(profile); } catch (IOException | QuickLinksProfileEvaluationException ex) { LOG.error("Unable to parse quick link profile json: " + quickLinkProfileJson, ex); return new ShowAllLinksVisibilityController(); } } }
QuickLinkVisibilityControllerFactory { public static QuickLinkVisibilityController get(@Nullable String quickLinkProfileJson) { if (null == quickLinkProfileJson) { LOG.info("No quick link profile is set, will display all quicklinks."); return new ShowAllLinksVisibilityController(); } try { QuickLinksProfile profile = new QuickLinksProfileParser().parse(quickLinkProfileJson.getBytes()); return new DefaultQuickLinkVisibilityController(profile); } catch (IOException | QuickLinksProfileEvaluationException ex) { LOG.error("Unable to parse quick link profile json: " + quickLinkProfileJson, ex); return new ShowAllLinksVisibilityController(); } }  }
QuickLinkVisibilityControllerFactory { public static QuickLinkVisibilityController get(@Nullable String quickLinkProfileJson) { if (null == quickLinkProfileJson) { LOG.info("No quick link profile is set, will display all quicklinks."); return new ShowAllLinksVisibilityController(); } try { QuickLinksProfile profile = new QuickLinksProfileParser().parse(quickLinkProfileJson.getBytes()); return new DefaultQuickLinkVisibilityController(profile); } catch (IOException | QuickLinksProfileEvaluationException ex) { LOG.error("Unable to parse quick link profile json: " + quickLinkProfileJson, ex); return new ShowAllLinksVisibilityController(); } }  static QuickLinkVisibilityController get(@Nullable String quickLinkProfileJson); }
QuickLinkVisibilityControllerFactory { public static QuickLinkVisibilityController get(@Nullable String quickLinkProfileJson) { if (null == quickLinkProfileJson) { LOG.info("No quick link profile is set, will display all quicklinks."); return new ShowAllLinksVisibilityController(); } try { QuickLinksProfile profile = new QuickLinksProfileParser().parse(quickLinkProfileJson.getBytes()); return new DefaultQuickLinkVisibilityController(profile); } catch (IOException | QuickLinksProfileEvaluationException ex) { LOG.error("Unable to parse quick link profile json: " + quickLinkProfileJson, ex); return new ShowAllLinksVisibilityController(); } }  static QuickLinkVisibilityController get(@Nullable String quickLinkProfileJson);  }