/** * Compares this string to the specified {@code StringBuffer}. The result * is {@code true} if and only if this {@code CharSeq} represents the same * sequence of characters as the specified {@code StringBuffer}. This method * synchronizes on the {@code StringBuffer}. * * @param sb The {@code StringBuffer} to compare this {@code CharSeq} against * @return {@code true} if this {@code CharSeq} represents the same * sequence of characters as the specified {@code StringBuffer}, * {@code false} otherwise */ public boolean contentEquals(StringBuffer sb) { return back.contentEquals(sb); }
/** * Compares this string to the specified {@code CharSequence}. The * result is {@code true} if and only if this {@code CharSeq} represents the * same sequence of char values as the specified sequence. Note that if the * {@code CharSequence} is a {@code StringBuffer} then the method * synchronizes on it. * * @param cs The sequence to compare this {@code CharSeq} against * @return {@code true} if this {@code CharSeq} represents the same * sequence of char values as the specified sequence, {@code * false} otherwise */ public boolean contentEquals(CharSequence cs) { return back.contentEquals(cs); }
public void setGvMethod(String sval) { if (sval.contentEquals("gradient")) gvMethodGradient = true; else gvMethodGradient = false; // then simple derivative method is used }
public void setGvMethod(String sval) { if (sval.contentEquals("gradient")) gvMethodGradient = true; else gvMethodGradient = false; // then simple derivative method is used }
/** * Returns true if the the given member is a method that overrides {@link Object#equals(Object)}. * * <p>The documentation for {@link Object#equals} says it should accept null, so don't require an * explicit {@code @Nullable} annotation (see <a * href="https://github.com/google/guava/issues/1819">#1819</a>). * * <p>It is not necessary to consider visibility, return type, or type parameter declarations. The * declaration of a method with the same name and formal parameters as {@link Object#equals} that * is not public and boolean-returning, or that declares any type parameters, would be rejected at * compile-time. */ private static boolean isEquals(Member member) { if (!(member instanceof Method)) { return false; } Method method = (Method) member; if (!method.getName().contentEquals("equals")) { return false; } Class<?>[] parameters = method.getParameterTypes(); if (parameters.length != 1) { return false; } if (!parameters[0].equals(Object.class)) { return false; } return true; }
private static int indexOfLastZero(@NotNull CharSequence str) { int i = str.length() - 3; do { i -= LENGTH; CharSequence charSequence = str.subSequence(i, i + 3); if (!", 0".contentEquals(charSequence)) return i + LENGTH; } while (i > 3); return 0; } }
public Boolean validateType(String type) { if(type == null || type.trim().isEmpty()) return false; for(String classType : groupClassTypes) { if(type.trim().contentEquals(classType)) return true; } return false; } }
@Override public boolean contentEquals(@Nullable CharSequence cs) { return cs != null && contents().contentEquals(cs); }
/** * Like {@link #contains(String, String, boolean)} but accepting {@code CharSequence} parameters. */ @GenIgnore(GenIgnore.PERMITTED_TYPE) default boolean contains(CharSequence name, CharSequence value, boolean caseInsensitive) { Predicate<String> predicate; if (caseInsensitive) { String valueAsString = value.toString(); predicate = val -> val.equalsIgnoreCase(valueAsString); } else { predicate = val -> val.contentEquals(value); } return getAll(name).stream().anyMatch(predicate); }
protected byte[] getRow(final String row, final String encoding) { //check to see if we need to modify the rowKey before we pass it down to the PutFlowFile byte[] rowKeyBytes = null; if(BINARY_ENCODING_VALUE.contentEquals(encoding)){ rowKeyBytes = clientService.toBytesBinary(row); }else{ rowKeyBytes = row.getBytes(StandardCharsets.UTF_8); } return rowKeyBytes; } /**
public static boolean isLikelyUriJavascriptContextLegacy(CharSequence candidate) { if(!TextUtils.matches(STRING_URI_DETECTOR,candidate)) { return false; } for (String s : STRING_URI_DETECTOR_EXCEPTIONS) { if (s.contentEquals(candidate)) return false; } // matches detector and not an exception: so a likely URI return true; }
/** Sets the first {@link TextButton} with the specified text to checked. */ public void setChecked (String text) { if (text == null) throw new IllegalArgumentException("text cannot be null."); for (int i = 0, n = buttons.size; i < n; i++) { T button = buttons.get(i); if (button instanceof TextButton && text.contentEquals(((TextButton)button).getText())) { button.setChecked(true); return; } } }
/** Sets the first {@link TextButton} with the specified text to checked. */ public void setChecked (String text) { if (text == null) throw new IllegalArgumentException("text cannot be null."); for (int i = 0, n = buttons.size; i < n; i++) { T button = buttons.get(i); if (button instanceof TextButton && text.contentEquals(((TextButton)button).getText())) { button.setChecked(true); return; } } }
static String iterationOrder(Iterable<? extends Node> iterable) { StringBuilder builder = new StringBuilder(); for (Node t : iterable) { builder.append(t.value); } StringBuilder forEachBuilder = new StringBuilder(); iterable.forEach(t -> forEachBuilder.append(t.value)); assertTrue( "Iterator content was " + builder + " but forEach content was " + forEachBuilder, builder.toString().contentEquals(forEachBuilder)); return builder.toString(); }
/** * Ask for the Operating system name. * * @return a string that contains the current Operating System. */ private String getEnvironmentName() { String osName = getOsName(); if ( osName.contentEquals( "linux" ) ) { return osName + " " + getLinuxDistribution().toLowerCase(); } return osName; }
@NotNull private LongArrayValues array(@NotNull WireIn w, @NotNull LongArrayValues using, boolean index2index) { final StringBuilder sb = Wires.acquireStringBuilder(); @NotNull final ValueIn valueIn = w.readEventName(sb); String name = index2index ? "index2index" : "index"; if (!name.contentEquals(sb)) throw new IllegalStateException("expecting index, was " + sb); valueIn.int64array(using, this, (o1, o2) -> { }); return using; }
private static MessageHistory readHistoryFromWire(final Wire wire, MessageHistory history) { final StringBuilder sb = SBP.acquireStringBuilder(); ValueIn valueIn = wire.read(sb); if (!MethodReader.HISTORY.contentEquals(sb)) return null; valueIn.object(history, MessageHistory.class); return history; }
/** * Returns the {@link HttpResponseStatus} represented by the specified {@code code} and {@code reasonPhrase}. * If the specified code is a standard HTTP status {@code code} and {@code reasonPhrase}, a cached instance * will be returned. Otherwise, a new instance will be returned. * @param code The response code value. * @param reasonPhrase The response code reason phrase. * @return the {@link HttpResponseStatus} represented by the specified {@code code} and {@code reasonPhrase}. */ public static HttpResponseStatus valueOf(int code, String reasonPhrase) { HttpResponseStatus responseStatus = valueOf0(code); return responseStatus != null && responseStatus.reasonPhrase().contentEquals(reasonPhrase) ? responseStatus : new HttpResponseStatus(code, reasonPhrase); }
@Override public JCExpression staticReference( Inliner inliner, CharSequence topLevelClazz, CharSequence fullyQualifiedClazz, CharSequence member) { if (Refaster.class.getName().contentEquals(topLevelClazz)) { // Special handling to ensure that the pretty-printer always recognizes Refaster references return inliner .maker() .Select(inliner.maker().Ident(inliner.asName("Refaster")), inliner.asName(member)); } inliner.addStaticImport(fullyQualifiedClazz + "." + member); return inliner.maker().Ident(inliner.asName(member)); } };
@Override public JCExpression staticReference( Inliner inliner, CharSequence topLevelClazz, CharSequence fullyQualifiedClazz, CharSequence member) { if (Refaster.class.getName().contentEquals(topLevelClazz)) { // Special handling to ensure that the pretty-printer always recognizes Refaster references return inliner .maker() .Select(inliner.maker().Ident(inliner.asName("Refaster")), inliner.asName(member)); } return inliner .maker() .Select( classReference(inliner, topLevelClazz, fullyQualifiedClazz), inliner.asName(member)); } },