Class BasicURLComparator
- java.lang.Object
-
- net.shibboleth.utilities.java.support.net.impl.BasicURLComparator
-
- All Implemented Interfaces:
URIComparator
public class BasicURLComparator extends Object implements URIComparator
A basic implementation ofURIComparatorthat compares URL's by canonicalizing them as perSimpleURLCanonicalizer, and then compares the resulting string representations for equality usingObject.equals(java.lang.Object). IfisCaseInsensitive()is true, then the equality test is instead performed usingString.equalsIgnoreCase(String).
-
-
Field Summary
Fields Modifier and Type Field Description private booleancaseInsensitiveThe case-insensitivity flag.
-
Constructor Summary
Constructors Constructor Description BasicURLComparator()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleancompare(String uri1, String uri2)Compare two URI's (represented as strings) for equivalence.booleanisCaseInsensitive()Get the case-insensitivity flag value.voidsetCaseInsensitive(boolean flag)Set the case-insensitivity flag value.
-
-
-
Method Detail
-
isCaseInsensitive
public boolean isCaseInsensitive()
Get the case-insensitivity flag value.- Returns:
- Returns the caseInsensitive.
-
setCaseInsensitive
public void setCaseInsensitive(boolean flag)
Set the case-insensitivity flag value.- Parameters:
flag- The caseInsensitive to set.
-
compare
public boolean compare(@Nullable String uri1, @Nullable String uri2) throws URIExceptionCompare two URI's (represented as strings) for equivalence..- Specified by:
comparein interfaceURIComparator- Parameters:
uri1- first URI to compareuri2- second URI to compare- Returns:
- true if the URI's are equivalent, false otherwise
- Throws:
URIException- if the URI's can not be successfully evaluated
-
-