@ -175,7 +175,7 @@ public class SetWindowFieldsOperation
/ * *
/ * *
* Tiny little helper to allow fluent API usage for { @link # append ( ComputedField ) } .
* Tiny little helper to allow fluent API usage for { @link # append ( ComputedField ) } .
* /
* /
interface ComputedFieldAppender {
public interface ComputedFieldAppender {
/ * *
/ * *
* Specify the target field name .
* Specify the target field name .
@ -249,6 +249,7 @@ public class SetWindowFieldsOperation
return windowOperator ;
return windowOperator ;
}
}
@Nullable
public Window getWindow ( ) {
public Window getWindow ( ) {
return window ;
return window ;
}
}
@ -638,20 +639,15 @@ public class SetWindowFieldsOperation
Assert . notNull ( timeUnit , "TimeUnit must not be null" ) ;
Assert . notNull ( timeUnit , "TimeUnit must not be null" ) ;
switch ( timeUnit ) {
return switch ( timeUnit ) {
case DAYS :
case DAYS - > WindowUnits . DAY ;
return WindowUnits . DAY ;
case HOURS - > WindowUnits . HOUR ;
case HOURS :
case MINUTES - > WindowUnits . MINUTE ;
return WindowUnits . HOUR ;
case SECONDS - > WindowUnits . SECOND ;
case MINUTES :
case MILLISECONDS - > WindowUnits . MILLISECOND ;
return WindowUnits . MINUTE ;
default - > throw new IllegalArgumentException ( String . format ( "Cannot create WindowUnit from %s" , timeUnit ) ) ;
case SECONDS :
} ;
return WindowUnits . SECOND ;
case MILLISECONDS :
return WindowUnits . MILLISECOND ;
}
throw new IllegalArgumentException ( String . format ( "Cannot create WindowUnit from %s" , timeUnit ) ) ;
}
}
/ * *
/ * *
@ -664,26 +660,18 @@ public class SetWindowFieldsOperation
* /
* /
static WindowUnit from ( ChronoUnit chronoUnit ) {
static WindowUnit from ( ChronoUnit chronoUnit ) {
switch ( chronoUnit ) {
return switch ( chronoUnit ) {
case YEARS :
case YEARS - > WindowUnits . YEAR ;
return WindowUnits . YEAR ;
case WEEKS - > WindowUnits . WEEK ;
case WEEKS :
case MONTHS - > WindowUnits . MONTH ;
return WindowUnits . WEEK ;
case DAYS - > WindowUnits . DAY ;
case MONTHS :
case HOURS - > WindowUnits . HOUR ;
return WindowUnits . MONTH ;
case MINUTES - > WindowUnits . MINUTE ;
case DAYS :
case SECONDS - > WindowUnits . SECOND ;
return WindowUnits . DAY ;
case MILLIS - > WindowUnits . MILLISECOND ;
case HOURS :
default - > throw new IllegalArgumentException ( String . format ( "Cannot create WindowUnit from %s" , chronoUnit ) ) ;
return WindowUnits . HOUR ;
} ;
case MINUTES :
return WindowUnits . MINUTE ;
case SECONDS :
return WindowUnits . SECOND ;
case MILLIS :
return WindowUnits . MILLISECOND ;
}
throw new IllegalArgumentException ( String . format ( "Cannot create WindowUnit from %s" , chronoUnit ) ) ;
}
}
}
}