List of usage examples for java.time Month JUNE
Month JUNE
To view the source code for java.time Month JUNE.
Click Source Link
From source file:Main.java
public static List<Employee> persons() { Employee p1 = new Employee(1, "Jake", Gender.MALE, LocalDate.of(1971, Month.JANUARY, 1), 2343.0); Employee p2 = new Employee(2, "Jack", Gender.MALE, LocalDate.of(1972, Month.JULY, 21), 7100.0); Employee p3 = new Employee(3, "Jane", Gender.FEMALE, LocalDate.of(1973, Month.MAY, 29), 5455.0); Employee p4 = new Employee(4, "Jode", Gender.MALE, LocalDate.of(1974, Month.OCTOBER, 16), 1800.0); Employee p5 = new Employee(5, "Jeny", Gender.FEMALE, LocalDate.of(1975, Month.DECEMBER, 13), 1234.0); Employee p6 = new Employee(6, "Jason", Gender.MALE, LocalDate.of(1976, Month.JUNE, 9), 3211.0); List<Employee> persons = Arrays.asList(p1, p2, p3, p4, p5, p6); return persons; }
From source file:Main.java
public static Boolean isFamilyBirthday(TemporalAccessor date) { int month = date.get(ChronoField.MONTH_OF_YEAR); int day = date.get(ChronoField.DAY_OF_MONTH); // Angie's birthday is on April 3. if ((month == Month.APRIL.getValue()) && (day == 3)) return Boolean.TRUE; // Sue's birthday is on June 18. if ((month == Month.JUNE.getValue()) && (day == 18)) return Boolean.TRUE; // Joe's birthday is on May 29. if ((month == Month.MAY.getValue()) && (day == 29)) return Boolean.TRUE; return Boolean.FALSE; }
From source file:Main.java
public static List<Employee> persons() { Employee p1 = new Employee(1, "Jake", Gender.MALE, LocalDate.of(1971, Month.JANUARY, 1), 2343.0); Employee p2 = new Employee(2, "Jack", Gender.MALE, LocalDate.of(1972, Month.JULY, 21), 7100.0); Employee p3 = new Employee(3, "Jane", Gender.FEMALE, LocalDate.of(1973, Month.MAY, 29), 5455.0); Employee p4 = new Employee(4, "Jode", Gender.MALE, LocalDate.of(1974, Month.OCTOBER, 16), 1800.0); Employee p5 = new Employee(5, "Jeny", Gender.FEMALE, LocalDate.of(1975, Month.DECEMBER, 13), 1234.0); Employee p6 = new Employee(6, "Jason", Gender.MALE, LocalDate.of(1976, Month.JUNE, 9), 3211.0); List<Employee> persons = Arrays.asList(p1, p2, p3, p4, p5, p6); return persons; }
From source file:io.sqp.core.types.SqpDateTest.java
@Test(dataProvider = "dateValues") public void CanDecodeFromJson(byte[] content, DataFormat format) throws Exception { ObjectMapper mapper = JacksonObjectMapperFactory.objectMapper(format); Object dateObj = mapper.readValue(content, Object.class); SqpDate sqpDate = SqpDate.fromJsonFormatValue(dateObj); LocalDate localDate = sqpDate.asLocalDate(); assertThat(localDate.getYear(), is(2015)); assertThat(localDate.getMonth(), is(Month.JUNE)); assertThat(localDate.getDayOfMonth(), is(28)); }
From source file:io.sqp.core.types.SqpTimestampTest.java
@Test public void CanDecodeFromJson() throws Exception { String content = "[[2015, 6, 28], [[13, 52, 5, 123456],7260]]"; ObjectMapper mapper = JacksonObjectMapperFactory.objectMapper(DataFormat.Text); Object timeObj = mapper.readValue(content, Object.class); SqpTimestamp sqpTimestamp = SqpTimestamp.fromJsonFormatValue(timeObj); OffsetDateTime timestamp = sqpTimestamp.asOffsetDateTime(); assertThat(timestamp.getHour(), is(13)); assertThat(timestamp.getMinute(), is(52)); assertThat(timestamp.getSecond(), is(5)); assertThat(timestamp.getNano(), is(123456)); assertThat(timestamp.getOffset().getTotalSeconds(), is(7260)); assertThat(timestamp.getYear(), is(2015)); assertThat(timestamp.getMonth(), is(Month.JUNE)); assertThat(timestamp.getDayOfMonth(), is(28)); }
From source file:se.backede.jeconomix.forms.report.SingleTransactionReport.java
private DefaultCategoryDataset createDataset(TransactionReportDto reports) { String lineTitle = "Kronor"; Map<Month, BigDecimal> sums = new HashMap<>(); List<Month> monthList = new LinkedList<>(Arrays.asList(Month.values())); monthList.forEach((month) -> {/* www . ja v a 2 s . co m*/ sums.put(month, BigDecimal.valueOf(0)); }); reports.getTransctions().forEach((TransactionDto transaction) -> { monthList.stream().filter((month) -> (transaction.getBudgetMonth().equals(month))) .forEachOrdered((month) -> { BigDecimal currentSum = sums.get(month); if (transaction.getSum() != null) { double abs = Math.abs(transaction.getSum().doubleValue()); BigDecimal newSum = currentSum.add(BigDecimal.valueOf(abs)); sums.put(month, newSum); } }); }); DefaultCategoryDataset dataset = new DefaultCategoryDataset(); dataset.addValue(sums.get(Month.JANUARY), lineTitle, "Jan"); dataset.addValue(sums.get(Month.FEBRUARY), lineTitle, "Feb"); dataset.addValue(sums.get(Month.MARCH), lineTitle, "Mar"); dataset.addValue(sums.get(Month.APRIL), lineTitle, "Apr"); dataset.addValue(sums.get(Month.MAY), lineTitle, "May"); dataset.addValue(sums.get(Month.JUNE), lineTitle, "Jun"); dataset.addValue(sums.get(Month.JULY), lineTitle, "Jul"); dataset.addValue(sums.get(Month.AUGUST), lineTitle, "Aug"); dataset.addValue(sums.get(Month.SEPTEMBER), lineTitle, "Sep"); dataset.addValue(sums.get(Month.OCTOBER), lineTitle, "Oct"); dataset.addValue(sums.get(Month.NOVEMBER), lineTitle, "Nov"); dataset.addValue(sums.get(Month.DECEMBER), lineTitle, "Dec"); return dataset; }