@Override protected void propertySet(Bean bean, String propertyName, Object newValue, boolean quiet) { metaProperty(propertyName); if (quiet) { return; } throw new UnsupportedOperationException("Property cannot be written: " + propertyName); }
public void test_immutableViaBeanBuilder() { LocalDate startDate = DATE_2010_01_01; double[] values = {6, 5, 4}; BeanBuilder<? extends DenseLocalDateDoubleTimeSeries> builder = DenseLocalDateDoubleTimeSeries.meta().builder(); builder.set("startDate", startDate); builder.set("points", values); builder.set("dateCalculation", INCLUDE_WEEKENDS); DenseLocalDateDoubleTimeSeries test = builder.build(); values[0] = -1; LocalDateDoublePoint[] points = test.stream().toArray(LocalDateDoublePoint[]::new); assertEquals(points[0], LocalDateDoublePoint.of(DATE_2010_01_01, 6d)); assertEquals(points[1], LocalDateDoublePoint.of(DATE_2010_01_02, 5d)); assertEquals(points[2], LocalDateDoublePoint.of(DATE_2010_01_03, 4d)); }