
package net.northking.cctp.scriptcase.tools.hapUtil.module;

import com.google.gson.annotations.SerializedName;

import java.util.List;

@SuppressWarnings("unused")
public class Module {


    @SerializedName("abilities")
    private List<Ability> mAbilities;
    @SerializedName("compileMode")
    private String mCompileMode;
    @SerializedName("deliveryWithInstall")
    private Boolean mDeliveryWithInstall;
    @SerializedName("dependencies")
    private List<Object> mDependencies;
    @SerializedName("description")
    private String mDescription;
    @SerializedName("descriptionId")
    private Long mDescriptionId;
    @SerializedName("deviceTypes")
    private List<String> mDeviceTypes;
    @SerializedName("extensionAbilities")
    private List<ExtensionAbility> mExtensionAbilities;
    @SerializedName("installationFree")
    private Boolean mInstallationFree;
    @SerializedName("mainElement")
    private String mMainElement;
    @SerializedName("name")
    private String mName;
    @SerializedName("packageName")
    private String mPackageName;
    @SerializedName("pages")
    private String mPages;
    @SerializedName("type")
    private String mType;
    @SerializedName("virtualMachine")
    private String mVirtualMachine;

    public List<Ability> getAbilities() {
        return mAbilities;
    }

    public void setAbilities(List<Ability> abilities) {
        mAbilities = abilities;
    }

    public String getCompileMode() {
        return mCompileMode;
    }

    public void setCompileMode(String compileMode) {
        mCompileMode = compileMode;
    }

    public Boolean getDeliveryWithInstall() {
        return mDeliveryWithInstall;
    }

    public void setDeliveryWithInstall(Boolean deliveryWithInstall) {
        mDeliveryWithInstall = deliveryWithInstall;
    }

    public List<Object> getDependencies() {
        return mDependencies;
    }

    public void setDependencies(List<Object> dependencies) {
        mDependencies = dependencies;
    }

    public String getDescription() {
        return mDescription;
    }

    public void setDescription(String description) {
        mDescription = description;
    }

    public Long getDescriptionId() {
        return mDescriptionId;
    }

    public void setDescriptionId(Long descriptionId) {
        mDescriptionId = descriptionId;
    }

    public List<String> getDeviceTypes() {
        return mDeviceTypes;
    }

    public void setDeviceTypes(List<String> deviceTypes) {
        mDeviceTypes = deviceTypes;
    }

    public List<ExtensionAbility> getExtensionAbilities() {
        return mExtensionAbilities;
    }

    public void setExtensionAbilities(List<ExtensionAbility> extensionAbilities) {
        mExtensionAbilities = extensionAbilities;
    }

    public Boolean getInstallationFree() {
        return mInstallationFree;
    }

    public void setInstallationFree(Boolean installationFree) {
        mInstallationFree = installationFree;
    }

    public String getMainElement() {
        return mMainElement;
    }

    public void setMainElement(String mainElement) {
        mMainElement = mainElement;
    }

    public String getName() {
        return mName;
    }

    public void setName(String name) {
        mName = name;
    }

    public String getPackageName() {
        return mPackageName;
    }

    public void setPackageName(String packageName) {
        mPackageName = packageName;
    }

    public String getPages() {
        return mPages;
    }

    public void setPages(String pages) {
        mPages = pages;
    }

    public String getType() {
        return mType;
    }

    public void setType(String type) {
        mType = type;
    }

    public String getVirtualMachine() {
        return mVirtualMachine;
    }

    public void setVirtualMachine(String virtualMachine) {
        mVirtualMachine = virtualMachine;
    }

    public Ability getDefaultHomeAbility() {
        if (mAbilities == null) return null;
        for (Ability ability : mAbilities) {
            List<Skill> skill = ability.getSkills();
            if (skill != null) {
                for (Skill s : skill) {
                    if (s.isDefaultHome()) {
                        return ability;
                    }
                }
            }
        }
        return null;
    }

}
