Merge pull request #3098 from eugenp/BAEL-1317

change time zone method name
This commit is contained in:
Loredana Crusoveanu 2017-11-22 00:51:16 +02:00 committed by GitHub
commit ea64def1ae
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 6 additions and 7 deletions

View File

@ -14,7 +14,7 @@ public class TimezoneDisplay {
GMT, UTC
}
public List<String> compileListFor(OffsetBase base) {
public List<String> getTimeZoneList(OffsetBase base) {
Set<String> availableZoneIds = ZoneId.getAvailableZoneIds();
LocalDateTime now = LocalDateTime.now();

View File

@ -8,12 +8,11 @@ public class TimezoneDisplayApp {
TimezoneDisplay display = new TimezoneDisplay();
System.out.println("Time zones in UTC:");
List<String> utc = display.compileListFor(TimezoneDisplay.OffsetBase.UTC);
List<String> utc = display.getTimeZoneList(TimezoneDisplay.OffsetBase.UTC);
utc.forEach(System.out::println);
System.out.println("Time zones in GMT:");
List<String> gmt = display.compileListFor(TimezoneDisplay.OffsetBase.GMT);
List<String> gmt = display.getTimeZoneList(TimezoneDisplay.OffsetBase.GMT);
gmt.forEach(System.out::println);
}
}

View File

@ -12,7 +12,7 @@ public class TimezoneDisplayJava7 {
GMT, UTC
}
public List<String> compileListFor(TimezoneDisplayJava7.OffsetBase base) {
public List<String> getTimeZoneList(TimezoneDisplayJava7.OffsetBase base) {
String[] availableZoneIds = TimeZone.getAvailableIDs();
List<String> result = new ArrayList<>(availableZoneIds.length);

View File

@ -8,13 +8,13 @@ public class TimezoneDisplayJava7App {
TimezoneDisplayJava7 display = new TimezoneDisplayJava7();
System.out.println("Time zones in UTC:");
List<String> utc = display.compileListFor(TimezoneDisplayJava7.OffsetBase.UTC);
List<String> utc = display.getTimeZoneList(TimezoneDisplayJava7.OffsetBase.UTC);
for (String timeZone : utc) {
System.out.println(timeZone);
}
System.out.println("Time zones in GMT:");
List<String> gmt = display.compileListFor(TimezoneDisplayJava7.OffsetBase.GMT);
List<String> gmt = display.getTimeZoneList(TimezoneDisplayJava7.OffsetBase.GMT);
for (String timeZone : gmt) {
System.out.println(timeZone);
}