/** * @return <code>true</code> if the parameters are empty, <code>false</code> otherwise. */ public boolean isEmpty() { return (getIndexedCount() == 0) && getNamedKeys().isEmpty(); }
/** * @return <code>true</code> if the parameters are empty, <code>false</code> otherwise. */ public boolean isEmpty() { return (getIndexedCount() == 0) && getNamedKeys().isEmpty(); }
/** * Compares two {@link PageParameters} objects. * * @param p1 * The first parameters * @param p2 * The second parameters * @return <code>true</code> if the objects are equal, <code>false</code> otherwise. */ public static boolean equals(final PageParameters p1, final PageParameters p2) { if (Objects.equal(p1, p2)) { return true; } if ((p1 == null) && (p2.getIndexedCount() == 0) && p2.getNamedKeys().isEmpty()) { return true; } if ((p2 == null) && (p1.getIndexedCount() == 0) && p1.getNamedKeys().isEmpty()) { return true; } return false; }
/** * Compares two {@link PageParameters} objects. * * @param p1 * The first parameters * @param p2 * The second parameters * @return <code>true</code> if the objects are equal, <code>false</code> otherwise. */ public static boolean equals(final PageParameters p1, final PageParameters p2) { if (Objects.equal(p1, p2)) { return true; } if ((p1 == null) && (p2.getIndexedCount() == 0) && p2.getNamedKeys().isEmpty()) { return true; } if ((p2 == null) && (p1.getIndexedCount() == 0) && p1.getNamedKeys().isEmpty()) { return true; } return false; }
Set<String> keys = parameters.getNamedKeys(); if (info != null || !keys.isEmpty()) { builder.append("?");
public static void updateHintStoreUNUSED( final PageParameters pageParameters, final ObjectAdapterMemento objectAdapterMemento) { if(objectAdapterMemento == null) { return; } Set<String> namedKeys = pageParameters.getNamedKeys(); if (namedKeys.contains("no-hints")) { getHintStore().removeAll(objectAdapterMemento.asHintingBookmark()); return; } List<ComponentHintKey> newComponentHintKeys = Lists.newArrayList(); for (String namedKey : namedKeys) { if (namedKey.startsWith(PREFIX)) { String value = pageParameters.get(namedKey).toString(null); String key = namedKey.substring(5); final ComponentHintKey componentHintKey = ComponentHintKey.create(key); newComponentHintKeys.add(componentHintKey); final Bookmark bookmark = objectAdapterMemento.asHintingBookmark(); componentHintKey.set(bookmark, value); } } }
public void updateHintStore( final PageParameters pageParameters) { Set<String> namedKeys = pageParameters.getNamedKeys(); if(namedKeys.contains("no-hints")) { getHintStore().removeAll(entityModel.getObjectAdapterMemento().asBookmark()); return; } List<ComponentHintKey> newComponentHintKeys = Lists.newArrayList(); for (String namedKey : namedKeys) { if(namedKey.startsWith(PREFIX)) { String value = pageParameters.get(namedKey).toString(null); String key = namedKey.substring(5); final ComponentHintKey componentHintKey = ComponentHintKey.create(key); newComponentHintKeys.add(componentHintKey); final Bookmark bookmark = entityModel.getObjectAdapterMemento().asBookmark(); componentHintKey.set(bookmark, value); } } }
if (placeholder != null) if (parameters.getNamedKeys().contains(placeholder)) if (parameters.getNamedKeys().contains(optionalPlaceholder))
if (placeholder != null) if (parameters.getNamedKeys().contains(placeholder)) if (parameters.getNamedKeys().contains(optionalPlaceholder))
if (params.getNamedKeys().contains(LINES)) { if (params.get(LINES).toInt() > 0) { lines = params.get(LINES).toInt();
/** * Merges the page parameters into this, overwriting existing values * * @param other * The parameters to merge * @return this instance, for chaining */ public PageParameters mergeWith(final PageParameters other) { if (other != null && this != other) { for (int index = 0; index < other.getIndexedCount(); index++) { if (!other.get(index).isNull()) { set(index, other.get(index)); } } for (String name : other.getNamedKeys()) { remove(name); } for (NamedPair curNamed : other.getAllNamed()) { add(curNamed.getKey(), curNamed.getValue(), curNamed.getType()); } } return this; }
/** * Merges the page parameters into this, overwriting existing values * * @param other * The parameters to merge * @return this instance, for chaining */ public PageParameters mergeWith(final PageParameters other) { if (other != null && this != other) { for (int index = 0; index < other.getIndexedCount(); index++) { if (!other.get(index).isNull()) { set(index, other.get(index)); } } for (String name : other.getNamedKeys()) { remove(name); } for (NamedPair curNamed : other.getAllNamed()) { add(curNamed.getKey(), curNamed.getValue(), curNamed.getType()); } } return this; }