DATACMNS-66 - Polishing.

Removed Part.shouldAlwaysIgnoreCase() and don't constraint Part.shouldIgnoreCase() to String parts anymore.
This commit is contained in:
Phillip Webb
2011-08-25 19:42:04 +01:00
committed by Oliver Gierke
parent 7ff8a43a75
commit f96dc0817a
3 changed files with 2 additions and 30 deletions

View File

@@ -114,10 +114,6 @@ public class Part {
*/
public boolean shouldIgnoreCase() {
if (!String.class.equals(getProperty().getType())) {
return false;
}
return ignoreCase;
}
@@ -207,8 +203,7 @@ public class Part {
/**
* Creates a new {@link Type} using the given keyword, number of arguments to be bound and operator. Keyword and
* operator can be {@literal null}.
*
* @param operator
*
* @param numberOfArguments
* @param keywords
*/

View File

@@ -116,16 +116,6 @@ public class PartTree implements Iterable<OrPart> {
return result;
}
/**
* Returns <tt>true</tt> if all String based selections should not consider sentence case.
*
* @return <tt>true</tt> if case is ignored
*/
public boolean shouldAlwaysIgnoreCase() {
return predicate.shouldAlwaysIgnoreCase();
}
@Override
public String toString() {
@@ -140,7 +130,7 @@ public class PartTree implements Iterable<OrPart> {
*
* @param text the text to split
* @param keyword the keyword to split around
* @return an arry of split items
* @return an array of split items
*/
private static String[] split(String text, String keyword) {
@@ -259,9 +249,5 @@ public class PartTree implements Iterable<OrPart> {
public OrderBySource getOrderBySource() {
return orderBySource;
}
public boolean shouldAlwaysIgnoreCase() {
return alwaysIgnoreCase;
}
}
}

View File

@@ -160,7 +160,6 @@ public class PartTreeUnitTests {
private void detectsIgnoreAllCase(String source, boolean expected) throws Exception {
PartTree tree = partTree(source);
assertThat(tree.shouldAlwaysIgnoreCase(), is(expected));
for (Part part : tree.getParts()) {
assertThat(part.shouldIgnoreCase(), is(expected));
}
@@ -184,14 +183,6 @@ public class PartTreeUnitTests {
assertThat(parts.next().shouldIgnoreCase(), is(false));
}
@Test
public void doesNotIgnoreCaseIfNotStringProperty() throws Exception {
PartTree tree = partTree("findByLocationIgnoringCase");
assertPart(tree, parts("location"));
Iterator<Part> parts = tree.getParts().iterator();
assertThat(parts.next().shouldIgnoreCase(), is(false));
}
private PartTree partTree(String source) {
return new PartTree(source, User.class);
}