@Override public String toString() { return asString("Pair[", "first=", first, ", second=", second, "]"); } }
public CascadingOption (Option parent, Option child) { this.options = Pair.nicePairOf(parent, child); }
public QueryBuilder<P> filter(final Matcher<? super P> filter) { this.filter = GuavaPredicates.forMatcher(filter); return this; }
@Override public void doFilter(final ServletRequest servletRequest, final ServletResponse servletResponse, final FilterChain filterChain) throws IOException, ServletException { Pair<ServletRequest, ServletResponse> debugWrapped = wrap(servletRequest, servletResponse); super.doFilter(debugWrapped.first(), debugWrapped.second(), filterChain); }
public Option getParent() { return this.options.first(); }
public Option getChild() { return this.options.second(); }
/** * By default we create a strict pair of non-null values. * * @param first first value * @param second second value * @param <U> type of first value * @param <V> type of second value * @return new pair * @see #strictPairOf(Object, Object) */ public static <U,V> Pair<U,V> of(U first, V second) { return strictPairOf(first, second); }
private static Pair<String, String> splitAndTrim(final String pluginModule) { String[] split = pluginModule.split(":"); String pluginKey = split.length < 1 ? "" : split[0].trim(); String moduleKey = split.length < 2 ? "" : split[1].trim(); return Pair.of(pluginKey, moduleKey); }
/** * A pair that does allows <code>null</code> values. * * @param first first value, may be <code>null</code> * @param second second value, may be <code>null</code> * @param <U> type of first value * @param <V> type of second value * @return new nice pair */ public static <U,V> Pair<U,V> nicePairOf(@Nullable U first, @Nullable V second) { return new Pair<U,V>(first, second); }
@Override public KeyPair getKeyPair() { return cache.get().first(); }
@Override public boolean isSnapshot() { return parseVersion(getVersion()).second().toUpperCase().startsWith("-SNAPSHOT"); }
@Override public String toString() { return asString("WorkflowIssueAction[workflowActionId=",workflowActionId,",id=",id,",uiName=",uiName,"]"); } }
public MultipleKeyRegistrant<T> implementing(final Class<? super T> interfaceClass, final ComponentContainer.Scope desiredScope) { implementing.add(Pair.<Class<? super T>, ComponentContainer.Scope>nicePairOf(interfaceClass, desiredScope)); return this; }
@Override public SearchQuery<T> filter(Matcher<? super T> filter) { this.filter = GuavaPredicates.forMatcher(filter); return this; }
public int[] getVersionNumbers() { return parseVersion(getVersion()).first(); }
@Override public boolean isRc() { return parseVersion(getVersion()).second().toLowerCase().startsWith("-rc"); }
@Override public String toString() { return asString("Suggestion[mainLabel=", getMainLabel(), ",aliasLabel=", getAliasLabel(), "]"); }
private Pair<String, Long> valueAndOffSet(Object fieldValue, String fieldName) { String value; Long offset; if (fieldValue != null) { offset = getPeriodOffset(fieldName); value = formatFieldValue(fieldValue, offset); } else { value = null; offset = null; } return Pair.nicePairOf(value, offset); }
public PageElement find(By by, Matcher<PageElement> filter) { return find(by, forMatcher(filter)); }
public List<PageElement> findAll(By by, Matcher<PageElement> matcher) { return findAll(by, forMatcher(matcher)); }