/** * Returns the first parameter found with the given name. * * @param name * The parameter name. * @param ignoreCase * Indicates if the name comparison is case sensitive. * @return The first parameter found with the given name. */ public E getFirst(String name, boolean ignoreCase) { for (final E param : this) { if (equals(param.getName(), name, ignoreCase)) { return param; } } return null; }
/** * Returns the first parameter found with the given name. * * @param name * The parameter name. * @param ignoreCase * Indicates if the name comparison is case insensitive. * @return The first parameter found with the given name. */ public T getFirst(String name, boolean ignoreCase) { for (T param : this) { if (equals(param.getName(), name, ignoreCase)) { return param; } } return null; }
/** * Returns the first parameter found with the given name. * * @param name * The parameter name. * @param ignoreCase * Indicates if the name comparison is case insensitive. * @return The first parameter found with the given name. */ public T getFirst(String name, boolean ignoreCase) { for (T param : this) { if (equals(param.getName(), name, ignoreCase)) { return param; } } return null; }
/** * Removes all the parameters with a given name. * * @param name * The parameter name. * @param ignoreCase * Indicates if the name comparison is case sensitive. * @return True if the list changed. */ public boolean removeAll(String name, boolean ignoreCase) { boolean changed = false; Parameter param = null; for (final Iterator<E> iter = iterator(); iter.hasNext();) { param = iter.next(); if (equals(param.getName(), name, ignoreCase)) { iter.remove(); changed = true; } } return changed; }
/** * Removes from this list the first entry whose name equals the specified * name ignoring the case or not. * * @param name * The name of the entries to be removed. * @param ignoreCase * true if the comparison ignores the case, false otherwise. * @return false if no entry has been removed, true otherwise. */ public boolean removeFirst(String name, boolean ignoreCase) { boolean changed = false; Parameter param = null; for (final Iterator<E> iter = iterator(); iter.hasNext() && !changed;) { param = iter.next(); if (equals(param.getName(), name, ignoreCase)) { iter.remove(); changed = true; } } return changed; }
/** * Removes all the parameters with a given name. * * @param name * The parameter name. * @param ignoreCase * Indicates if the name comparison is case insensitive. * @return True if the list changed. */ public boolean removeAll(String name, boolean ignoreCase) { boolean changed = false; NamedValue<String> param = null; for (Iterator<T> iter = iterator(); iter.hasNext();) { param = iter.next(); if (equals(param.getName(), name, ignoreCase)) { iter.remove(); changed = true; } } return changed; }
/** * Removes from this list the first entry whose name equals the specified * name ignoring the case or not. * * @param name * The name of the entries to be removed. * @param ignoreCase * Indicates if the name comparison is case insensitive. * @return false if no entry has been removed, true otherwise. */ public boolean removeFirst(String name, boolean ignoreCase) { boolean changed = false; NamedValue<String> param = null; for (final Iterator<T> iter = iterator(); iter.hasNext() && !changed;) { param = iter.next(); if (equals(param.getName(), name, ignoreCase)) { iter.remove(); changed = true; } } return changed; }
/** * Removes all the parameters with a given name. * * @param name * The parameter name. * @param ignoreCase * Indicates if the name comparison is case insensitive. * @return True if the list changed. */ public boolean removeAll(String name, boolean ignoreCase) { boolean changed = false; NamedValue<String> param = null; for (Iterator<T> iter = iterator(); iter.hasNext();) { param = iter.next(); if (equals(param.getName(), name, ignoreCase)) { iter.remove(); changed = true; } } return changed; }
/** * Removes from this list the first entry whose name equals the specified * name ignoring the case or not. * * @param name * The name of the entries to be removed. * @param ignoreCase * Indicates if the name comparison is case insensitive. * @return false if no entry has been removed, true otherwise. */ public boolean removeFirst(String name, boolean ignoreCase) { boolean changed = false; NamedValue<String> param = null; for (final Iterator<T> iter = iterator(); iter.hasNext() && !changed;) { param = iter.next(); if (equals(param.getName(), name, ignoreCase)) { iter.remove(); changed = true; } } return changed; }
param = iter.next(); if (equals(param.getName(), name, ignoreCase)) { if (found) {
/** * Returns a list of all the values associated to the parameter name. * * @param name * The parameter name. * @param ignoreCase * Indicates if the name comparison is case sensitive. * @return The list of values. */ public Series<E> subList(String name, boolean ignoreCase) { final Series<E> result = createSeries(null); for (final E param : this) { if (equals(param.getName(), name, ignoreCase)) { result.add(param); } } return result; }
param = iter.next(); if (equals(param.getName(), name, ignoreCase)) { if (found) {
/** {@inheritDoc} */ @Override public boolean equals(final Object obj) { if (obj == this) { return true; } if (!(obj instanceof ChallengeRequest)) { return false; } final ChallengeRequest that = (ChallengeRequest) obj; return getParameters().equals(that.getParameters()) && Objects.equals(getRealm(), that.getRealm()) && Objects.equals(getScheme(), that.getScheme()); }
/** * Returns a list of all the values associated to the parameter name. * * @param name * The parameter name. * @param ignoreCase * Indicates if the name comparison is case insensitive. * @return The list of values. */ public Series<T> subList(String name, boolean ignoreCase) { Series<T> result = new Series<T>(this.entryClass); for (T param : this) { if (equals(param.getName(), name, ignoreCase)) { result.add(param); } } return result; }
/** * Returns a list of all the values associated to the parameter name. * * @param name * The parameter name. * @param ignoreCase * Indicates if the name comparison is case insensitive. * @return The list of values. */ public Series<T> subList(String name, boolean ignoreCase) { Series<T> result = new Series<T>(this.entryClass); for (T param : this) { if (equals(param.getName(), name, ignoreCase)) { result.add(param); } } return result; }
/** * Test the equality of two media types, with the possibility to ignore the * parameters. * * @param obj * The object to compare to. * @param ignoreParameters * Indicates if parameters should be ignored during comparison. * @return True if both media types are equal. */ public boolean equals(Object obj, boolean ignoreParameters) { boolean result = (obj == this); // if obj == this no need to go further if (!result) { // if obj isn't a mediatype or is null don't evaluate further if (obj instanceof MediaType) { final MediaType that = (MediaType) obj; if (getMainType().equals(that.getMainType()) && getSubType().equals(that.getSubType())) { result = ignoreParameters || getParameters().equals(that.getParameters()); } } } return result; }
/** * Test the equality of two media types, with the possibility to ignore the * parameters. * * @param obj * The object to compare to. * @param ignoreParameters * Indicates if parameters should be ignored during comparison. * @return True if both media types are equal. */ public boolean equals(Object obj, boolean ignoreParameters) { boolean result = (obj == this); // if obj == this no need to go further if (!result) { // test for equality at Metadata level i.e. name and value. if (super.equals(obj)) { // if obj isn't a mediatype or is null don't evaluate further if (obj instanceof MediaType) { final MediaType that = (MediaType) obj; result = ignoreParameters || getParameters().equals(that.getParameters()); } } } return result; }
@Override public boolean equals(Object obj) { if (obj == this) { return true; } if (!(obj instanceof ChallengeMessage)) { return false; } final ChallengeMessage that = (ChallengeMessage) obj; return getParameters().equals(that.getParameters()) && Objects.equals(getRealm(), that.getRealm()) && Objects.equals(getScheme(), that.getScheme()) && Objects.equals(getServerNonce(), that.getServerNonce()) && Objects.equals(getOpaque(), that.getOpaque()) && Objects.equals(getDigestAlgorithm(), that.getDigestAlgorithm()); }
/** * Test the equality of two media types, with the possibility to ignore the * parameters. * * @param obj * The object to compare to. * @param ignoreParameters * Indicates if parameters should be ignored during comparison. * @return True if both media types are equal. */ public boolean equals(Object obj, boolean ignoreParameters) { boolean result = (obj == this); // if obj == this no need to go further if (!result) { // if obj isn't a mediatype or is null don't evaluate further if (obj instanceof MediaType) { final MediaType that = (MediaType) obj; if (getMainType().equals(that.getMainType()) && getSubType().equals(that.getSubType())) { result = ignoreParameters || getParameters().equals(that.getParameters()); } } } return result; }
/** {@inheritDoc} */ @Override public final boolean equals(final Object obj) { boolean result = (obj == this); // if obj == this no need to go further if (!result) { // if obj isn't a challenge request or is null don't evaluate // further if (obj instanceof ChallengeRequest) { final ChallengeRequest that = (ChallengeRequest) obj; result = (getParameters().equals(that.getParameters())); if (result) { if (getRealm() != null) { result = getRealm().equals(that.getRealm()); } else { result = (that.getRealm() == null); } if (result) { if (getScheme() != null) { result = getScheme().equals(that.getScheme()); } else { result = (that.getScheme() == null); } } } } } return result; }