SOLR-10303: Switched to pascal casing

This commit is contained in:
Gethin James 2017-03-20 17:08:15 +01:00 committed by Joel Bernstein
parent c6fbb27376
commit b314bc6776
2 changed files with 7 additions and 7 deletions

View File

@ -41,7 +41,7 @@ import org.apache.solr.client.solrj.io.stream.expr.StreamFactory;
*/ */
public class DatePartEvaluator extends NumberEvaluator { public class DatePartEvaluator extends NumberEvaluator {
public enum FUNCTION {year, month, day, dayofyear, dayofquarter, hour, minute, quarter, week, second, epoch} public enum FUNCTION {year, month, day, dayOfYear, dayOfQuarter, hour, minute, quarter, week, second, epoch}
private final FUNCTION function; private final FUNCTION function;
@ -122,7 +122,7 @@ public class DatePartEvaluator extends NumberEvaluator {
return date.get(ChronoField.MONTH_OF_YEAR); return date.get(ChronoField.MONTH_OF_YEAR);
case day: case day:
return date.get(ChronoField.DAY_OF_MONTH); return date.get(ChronoField.DAY_OF_MONTH);
case dayofyear: case dayOfYear:
return date.get(ChronoField.DAY_OF_YEAR); return date.get(ChronoField.DAY_OF_YEAR);
case hour: case hour:
return date.get(ChronoField.HOUR_OF_DAY); return date.get(ChronoField.HOUR_OF_DAY);
@ -130,7 +130,7 @@ public class DatePartEvaluator extends NumberEvaluator {
return date.get(ChronoField.MINUTE_OF_HOUR); return date.get(ChronoField.MINUTE_OF_HOUR);
case second: case second:
return date.get(ChronoField.SECOND_OF_MINUTE); return date.get(ChronoField.SECOND_OF_MINUTE);
case dayofquarter: case dayOfQuarter:
return date.get(IsoFields.DAY_OF_QUARTER); return date.get(IsoFields.DAY_OF_QUARTER);
case quarter: case quarter:
return date.get(IsoFields.QUARTER_OF_YEAR); return date.get(IsoFields.QUARTER_OF_YEAR);

View File

@ -145,8 +145,8 @@ public class DatePartEvaluatorTest {
testFunction("year(a)", "1995-12-31T23:59:59Z", 1995); testFunction("year(a)", "1995-12-31T23:59:59Z", 1995);
testFunction("month(a)","1995-12-31T23:59:59Z", 12); testFunction("month(a)","1995-12-31T23:59:59Z", 12);
testFunction("day(a)", "1995-12-31T23:59:59Z", 31); testFunction("day(a)", "1995-12-31T23:59:59Z", 31);
testFunction("dayofyear(a)", "1995-12-31T23:59:59Z", 365); testFunction("dayOfYear(a)", "1995-12-31T23:59:59Z", 365);
testFunction("dayofquarter(a)", "1995-12-31T23:59:59Z", 92); testFunction("dayOfQuarter(a)", "1995-12-31T23:59:59Z", 92);
testFunction("hour(a)", "1995-12-31T23:59:59Z", 23); testFunction("hour(a)", "1995-12-31T23:59:59Z", 23);
testFunction("minute(a)", "1995-12-31T23:59:59Z", 59); testFunction("minute(a)", "1995-12-31T23:59:59Z", 59);
testFunction("quarter(a)","1995-12-31T23:59:59Z", 4); testFunction("quarter(a)","1995-12-31T23:59:59Z", 4);
@ -159,8 +159,8 @@ public class DatePartEvaluatorTest {
testFunction("month(a)","2017-03-17T10:30:45Z", 3); testFunction("month(a)","2017-03-17T10:30:45Z", 3);
testFunction("day(a)", "2017-03-17T10:30:45Z", 17); testFunction("day(a)", "2017-03-17T10:30:45Z", 17);
testFunction("day('a')", "2017-03-17T10:30:45Z", 17); testFunction("day('a')", "2017-03-17T10:30:45Z", 17);
testFunction("dayofyear(a)", "2017-03-17T10:30:45Z", 76); testFunction("dayOfYear(a)", "2017-03-17T10:30:45Z", 76);
testFunction("dayofquarter(a)", "2017-03-17T10:30:45Z", 76); testFunction("dayOfQuarter(a)", "2017-03-17T10:30:45Z", 76);
testFunction("hour(a)", "2017-03-17T10:30:45Z", 10); testFunction("hour(a)", "2017-03-17T10:30:45Z", 10);
testFunction("minute(a)", "2017-03-17T10:30:45Z", 30); testFunction("minute(a)", "2017-03-17T10:30:45Z", 30);
testFunction("quarter(a)","2017-03-17T10:30:45Z", 1); testFunction("quarter(a)","2017-03-17T10:30:45Z", 1);