@@ -0,0 +1,3654 @@
+/*%0A * Copyright (c) 2004-2019, University of Oslo%0A * All rights reserved.%0A *%0A * Redistribution and use in source and binary forms, with or without%0A * modification, are permitted provided that the following conditions are met:%0A * Redistributions of source code must retain the above copyright notice, this%0A * list of conditions and the following disclaimer.%0A *%0A * Redistributions in binary form must reproduce the above copyright notice,%0A * this list of conditions and the following disclaimer in the documentation%0A * and/or other materials provided with the distribution.%0A * Neither the name of the HISP project nor the names of its contributors may%0A * be used to endorse or promote products derived from this software without%0A * specific prior written permission.%0A *%0A * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS %22AS IS%22 AND%0A * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED%0A * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE%0A * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR%0A * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES%0A * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;%0A * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON%0A * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT%0A * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS%0A * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.%0A */%0A%0Apackage org.hisp.dhis.android.core.trackedentity;%0A%0Aimport org.hisp.dhis.android.core.arch.repositories.children.ChildrenAppender;%0Aimport org.hisp.dhis.android.core.arch.repositories.object.ReadWriteValueObjectRepository;%0Aimport org.hisp.dhis.android.core.arch.repositories.object.ReadWriteWithValueObjectRepositoryImpl;%0Aimport org.hisp.dhis.android.core.arch.repositories.scope.RepositoryScope;%0Aimport org.hisp.dhis.android.core.common.DataStatePropagator;%0Aimport org.hisp.dhis.android.core.common.Unit;%0Aimport org.hisp.dhis.android.core.maintenance.D2Error;%0A%0Aimport java.util.Date;%0Aimport java.util.Map;%0A%0Apublic final class TrackedEntityAttributeValueObjectRepository extends ReadWriteWithValueObjectRepositoryImpl%0A        %3CTrackedEntityAttributeValue, TrackedEntityAttributeValueObjectRepository%3E%0A        implements ReadWriteValueObjectRepository%3CTrackedEntityAttributeValue%3E %7B%0A%0A    private final DataStatePropagator dataStatePropagator;%0A    private TrackedEntityAttributeValue trackedEntityAttributeValue;%0A%0A    TrackedEntityAttributeValueObjectRepository(%0A            final TrackedEntityAttributeValueStore store,%0A            final Map%3CString, ChildrenAppender%3CTrackedEntityAttributeValue%3E%3E childrenAppenders,%0A            final RepositoryScope scope,%0A            final DataStatePropagator dataStatePropagator) %7B%0A        super(store, childrenAppenders, scope, s -%3E new TrackedEntityAttributeValueObjectRepository(%0A                store, childrenAppenders, s, dataStatePropagator));%0A        this.dataStatePropagator = dataStatePropagator;%0A    %7D%0A%0A    public Unit set(String value) throws D2Error %7B%0A        return updateObject(updateBuilder().value(value).build());%0A    %7D%0A%0A    private TrackedEntityAttributeValue.Builder updateBuilder() %7B%0A        trackedEntityAttributeValue = getWithoutChildren();%0A        Date updateDate = new Date();%0A%0A        return trackedEntityAttributeValue.toBuilder()%0A                .lastUpdated(updateDate);%0A    %7D%0A%0A    @Override%0A    protected void propagateState() %7B%0A        dataStatePropagator.propagateTrackedEntityAttributeUpdate(trackedEntityAttributeValue);%0A    %7D%0A%7D

Add TrackedEntityAttributeValueObjectRepository