File tree Expand file tree Collapse file tree
core-java-8/src/main/java/com/baeldung/timezonedisplay
core-java/src/main/java/com/baeldung/timezonedisplay Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -14,7 +14,7 @@ public enum OffsetBase {
1414 GMT , UTC
1515 }
1616
17- public List <String > compileListFor (OffsetBase base ) {
17+ public List <String > getTimeZoneList (OffsetBase base ) {
1818 Set <String > availableZoneIds = ZoneId .getAvailableZoneIds ();
1919
2020 LocalDateTime now = LocalDateTime .now ();
Original file line number Diff line number Diff line change @@ -8,11 +8,11 @@ public static void main(String... args) {
88 TimezoneDisplay display = new TimezoneDisplay ();
99
1010 System .out .println ("Time zones in UTC:" );
11- List <String > utc = display .compileListFor (TimezoneDisplay .OffsetBase .UTC );
11+ List <String > utc = display .getTimeZoneList (TimezoneDisplay .OffsetBase .UTC );
1212 utc .forEach (System .out ::println );
1313
1414 System .out .println ("Time zones in GMT:" );
15- List <String > gmt = display .compileListFor (TimezoneDisplay .OffsetBase .GMT );
15+ List <String > gmt = display .getTimeZoneList (TimezoneDisplay .OffsetBase .GMT );
1616 gmt .forEach (System .out ::println );
1717 }
1818
Original file line number Diff line number Diff line change @@ -12,7 +12,7 @@ public enum OffsetBase {
1212 GMT , UTC
1313 }
1414
15- public List <String > compileListFor (TimezoneDisplayJava7 .OffsetBase base ) {
15+ public List <String > getTimeZoneList (TimezoneDisplayJava7 .OffsetBase base ) {
1616 String [] availableZoneIds = TimeZone .getAvailableIDs ();
1717 List <String > result = new ArrayList <>(availableZoneIds .length );
1818
Original file line number Diff line number Diff line change @@ -8,13 +8,13 @@ public static void main(String... args) {
88 TimezoneDisplayJava7 display = new TimezoneDisplayJava7 ();
99
1010 System .out .println ("Time zones in UTC:" );
11- List <String > utc = display .compileListFor (TimezoneDisplayJava7 .OffsetBase .UTC );
11+ List <String > utc = display .getTimeZoneList (TimezoneDisplayJava7 .OffsetBase .UTC );
1212 for (String timeZone : utc ) {
1313 System .out .println (timeZone );
1414 }
1515
1616 System .out .println ("Time zones in GMT:" );
17- List <String > gmt = display .compileListFor (TimezoneDisplayJava7 .OffsetBase .GMT );
17+ List <String > gmt = display .getTimeZoneList (TimezoneDisplayJava7 .OffsetBase .GMT );
1818 for (String timeZone : gmt ) {
1919 System .out .println (timeZone );
2020 }
You can’t perform that action at this time.
0 commit comments