Switch statement can be replaced with enhanced 'switch'.
This commit is contained in:
parent
9fe2630f42
commit
f5ae50ec34
|
|
@ -16,19 +16,13 @@ public class BarUtils
|
|||
*/
|
||||
public static BarStyle parseBarStyle(int style)
|
||||
{
|
||||
switch (style)
|
||||
{
|
||||
case 6:
|
||||
return BarStyle.SEGMENTED_6;
|
||||
case 10:
|
||||
return BarStyle.SEGMENTED_10;
|
||||
case 12:
|
||||
return BarStyle.SEGMENTED_12;
|
||||
case 20:
|
||||
return BarStyle.SEGMENTED_20;
|
||||
default:
|
||||
return BarStyle.SOLID;
|
||||
}
|
||||
return switch (style) {
|
||||
case 6 -> BarStyle.SEGMENTED_6;
|
||||
case 10 -> BarStyle.SEGMENTED_10;
|
||||
case 12 -> BarStyle.SEGMENTED_12;
|
||||
case 20 -> BarStyle.SEGMENTED_20;
|
||||
default -> BarStyle.SOLID;
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user