/*
 * Copyright (c) 2004-2019, University of Oslo
 * All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions are met:
 * Redistributions of source code must retain the above copyright notice, this
 * list of conditions and the following disclaimer.
 *
 * Redistributions in binary form must reproduce the above copyright notice,
 * this list of conditions and the following disclaimer in the documentation
 * and/or other materials provided with the distribution.
 * Neither the name of the HISP project nor the names of its contributors may
 * be used to endorse or promote products derived from this software without
 * specific prior written permission.
 *
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
 * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
 * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
 * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 */

package org.hisp.dhis.android.core.data.relationship;

import org.hisp.dhis.android.core.relationship.Relationship;
import org.hisp.dhis.android.core.relationship.Relationship229Compatible;
import org.hisp.dhis.android.core.relationship.RelationshipHelper;
import org.hisp.dhis.android.core.relationship.RelationshipItem;

import static org.hisp.dhis.android.core.data.utils.FillPropertiesTestUtils.CREATED;
import static org.hisp.dhis.android.core.data.utils.FillPropertiesTestUtils.LAST_UPDATED;
import static org.hisp.dhis.android.core.data.utils.FillPropertiesTestUtils.NAME;


public class RelationshipSamples {

    protected String UID = "uid";

    protected String FROM_UID = "fromUid";

    protected String TO_UID = "toUid";

    protected String TYPE = "type";

    protected RelationshipItem fromItem = RelationshipHelper.teiItem(FROM_UID);

    protected RelationshipItem toItem = RelationshipHelper.teiItem(TO_UID);

    protected RelationshipItem eventItem = RelationshipHelper.eventItem(TO_UID);

    private Relationship229Compatible.Builder commonCompatibleBuilder = Relationship229Compatible
            .builder()
            .created(CREATED)
            .lastUpdated(LAST_UPDATED)
            .name(NAME);

    protected Relationship.Builder commonBuilder = Relationship
            .builder()
            .created(CREATED)
            .lastUpdated(LAST_UPDATED)
            .name(NAME);

    public Relationship229Compatible get229Compatible() {
        return commonCompatibleBuilder
                .uid(TYPE)
                .trackedEntityInstanceA(FROM_UID)
                .trackedEntityInstanceB(TO_UID)
                .build();
    }

    public Relationship229Compatible get230Compatible() {
        return commonCompatibleBuilder
                .uid(UID)
                .relationshipType(TYPE)
                .from(fromItem)
                .to(toItem)
                .build();
    }

    protected Relationship get230() {
        return commonBuilder
                .uid(UID)
                .relationshipType(TYPE)
                .from(fromItem)
                .to(toItem)
                .build();
    }

    protected Relationship get230(String uid, String fromUid, String toUid) {
        return commonBuilder
                .uid(uid)
                .relationshipType(TYPE)
                .from(RelationshipHelper.teiItem(fromUid))
                .to(RelationshipHelper.teiItem(toUid))
                .build();
    }
}
@@ -2140,16 +2140,22 @@
 %0Apublic 
+final 
 class Re
@@ -2185,24 +2185,31 @@
   protected 
+static 
 String UID =
@@ -2227,24 +2227,31 @@
   protected 
+static 
 String FROM_
@@ -2274,32 +2274,39 @@
 %0A%0A    protected 
+static 
 String TO_UID = 
@@ -2329,16 +2329,23 @@
 otected 
+static 
 String T
@@ -2365,32 +2365,39 @@
 %0A%0A    protected 
+static 
 RelationshipItem
@@ -2453,32 +2453,39 @@
 %0A%0A    protected 
+static 
 RelationshipItem
@@ -2827,39 +2827,44 @@
 e(NAME);%0A%0A    pr
-otected
+ivate static
  Relationship.Bu
@@ -4071,10 +4071,201 @@
 );%0A    %7D
+%0A%0A    public static Relationship getRelationshipToInsertOnDB() %7B%0A        return commonBuilder%0A                .uid(UID)%0A                .relationshipType(TYPE)%0A                .build();%0A    %7D
 %0A%7D

Add RelationshipSamples