package com.bytedance.geckox.model;

import X.AnonymousClass84B;
import android.text.TextUtils;
import com.bytedance.covode.number.Covode;
import com.bytedance.geckox.model.CheckRequestBodyModel;
import com.google.gson.a.c;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
import java.util.List;

public class DeploymentModelV4 extends DeploymentModel {
    @c(LIZ = "group_name")
    public List<AnonymousClass84B> groupName;

    static {
        Covode.recordClassIndex(26505);
    }

    public List<AnonymousClass84B> getGroupName() {
        return this.groupName;
    }

    public DeploymentModelV4() {
        this.groupName = new ArrayList();
        this.targetChannels = new ArrayList();
    }

    public String getSortString() {
        return getSortStringByV4Group() + "-" + getSortStringByChannels();
    }

    private String getSortStringByV4Group() {
        List<AnonymousClass84B> list = this.groupName;
        if (list == null || list.isEmpty()) {
            return "";
        }
        Collections.sort(this.groupName, new Comparator<AnonymousClass84B>() {
            static {
                Covode.recordClassIndex(26506);
            }

            public final /* synthetic */ int compare(Object obj, Object obj2) {
                AnonymousClass84B r3 = (AnonymousClass84B) obj;
                AnonymousClass84B r4 = (AnonymousClass84B) obj2;
                if (r3 == null) {
                    if (r4 == null) {
                        return 0;
                    }
                    return -1;
                } else if (r4 == null) {
                    return 1;
                } else {
                    return r3.LIZ.compareTo(r4.LIZ);
                }
            }
        });
        StringBuffer stringBuffer = new StringBuffer();
        for (AnonymousClass84B next : this.groupName) {
            if (next != null && !TextUtils.isEmpty(next.LIZ)) {
                stringBuffer.append(next.LIZ);
            }
        }
        return stringBuffer.toString();
    }

    public void addToGroupName(Object obj) {
        this.groupName.add(obj);
    }

    public DeploymentModelV4(List<AnonymousClass84B> list, List<CheckRequestBodyModel.TargetChannel> list2) {
        this.groupName = list;
        this.targetChannels = list2;
    }
}
