/*
 * 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.settings;

import android.support.annotation.Nullable;

import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.google.auto.value.AutoValue;

import org.hisp.dhis.android.core.data.api.Field;
import org.hisp.dhis.android.core.data.api.Fields;

@AutoValue
public abstract class SystemSetting {
    private static final String KEY_FLAG = "keyFlag";
    private static final String KEY_STYLE = "keyStyle";

    static final Fields<SystemSetting> allFields = Fields.<SystemSetting>builder().fields(
            Field.<SystemSetting, String>create(KEY_FLAG),
            Field.<SystemSetting, String>create(KEY_STYLE)
    ).build();

    @Nullable
    @JsonProperty(KEY_FLAG)
    public abstract String keyFlag();

    @Nullable
    @JsonProperty(KEY_STYLE)
    public abstract String keyStyle();

    @JsonCreator
    public static SystemSetting create(
            @JsonProperty(KEY_FLAG) String keyFlag,
            @JsonProperty(KEY_STYLE) String keyStyle) {

        return new AutoValue_SystemSetting(
                keyFlag,
                keyStyle
        );
    }
}
@@ -1616,144 +1616,69 @@
 oid.
-support.annotation.Nullable;%0A%0Aimport com.fasterxml.jackson.annotation.JsonCreator;%0Aimport com.fasterxml.jackson.annotation.JsonProperty;
+database.Cursor;%0Aimport android.support.annotation.Nullable;%0A
 %0Aimp
@@ -1749,30 +1749,32 @@
 id.core.
-data.api.Fi
+common.BaseMod
 el
-d
 ;%0Aimport
@@ -1805,23 +1805,20 @@
 ore.
-data.api.Fields
+common.Model
 ;%0A%0A@
@@ -1867,603 +1867,574 @@
 ing 
-%7B%0A    private static final String KEY_FLAG = %22keyFlag%22;%0A    private static final String KEY_STYLE = %22keyStyle%22;%0A%0A    static final Fields%3CSystemSetting%3E allFields = Fields.%3CSystemSetting%3Ebuilder().fields(
+implements Model %7B%0A%0A    @Nullable%0A    public abstract String key();%0A%0A    @Nullable%0A    public abstract String value();%0A%0A    static SystemSetting create(Cursor cursor) %7B%0A        return $AutoValue_SystemSetting.createFromCursor(cursor);
 %0A    
+%7D%0A%0A
     
-    Field.%3CSystemSetting, String%3Ecreate(KEY_FLAG),%0A            Field.%3CSystemSetting, String%3Ecreate(KEY_STYLE)%0A    ).build();%0A%0A    @Nullable%0A    @JsonProperty(KEY_FLAG)%0A    public abstract String keyFlag();%0A%0A    @Nullable%0A    @JsonProperty(KEY_STYLE)%0A    public abstract String keyStyle();%0A%0A    @JsonCreator%0A    public static SystemSetting create(%0A            @JsonProperty(KEY_FLAG) 
+public abstract Builder toBuilder();%0A%0A    public static Builder builder() %7B%0A        return new AutoValue_SystemSetting.Builder();%0A    %7D%0A%0A    @AutoValue.Builder%0A    public abstract static class Builder extends BaseModel.Builder%3CBuilder%3E %7B%0A        public abstract Builder id(Long id);%0A%0A        public abstract Builder key(
 Stri
@@ -2435,29 +2435,27 @@
 y(String key
-Flag,
+);%0A
 %0A           
@@ -2455,159 +2455,98 @@
     
-    @JsonProperty(KEY_STYLE) String keyStyle) %7B%0A%0A        return new AutoValue_SystemSetting(%0A                keyFlag,%0A                keyStyle%0A        
+public abstract Builder value(String value);%0A%0A        public abstract SystemSetting build(
 );%0A 

Unify SystemSetting