package com.agilex.healthcare.schedulingmanager.util;

import java.util.List;

public class TextArrayUtils {
    public static com.agilex.healthcare.schedulingmanager.mdws.generatedwsdl.queryservice.TextArray subArray(com.agilex.healthcare.schedulingmanager.mdws.generatedwsdl.queryservice.TextArray textArray, int fromIndex, int toIndex) {
        List<String> subArray = textArray.getText().getString().subList(fromIndex, toIndex);
        com.agilex.healthcare.schedulingmanager.mdws.generatedwsdl.queryservice.ArrayOfString aos = new com.agilex.healthcare.schedulingmanager.mdws.generatedwsdl.queryservice.ArrayOfString();
        aos.getString().addAll(subArray);
        com.agilex.healthcare.schedulingmanager.mdws.generatedwsdl.queryservice.TextArray ta = new com.agilex.healthcare.schedulingmanager.mdws.generatedwsdl.queryservice.TextArray();
        ta.setText(aos);
        return ta;
    }

    public static int size(com.agilex.healthcare.schedulingmanager.mdws.generatedwsdl.queryservice.TextArray textArray) {
        if (isEmpty(textArray)) {
            return 0;
        }
        return textArray.getText().getString().size();
    }

    public static boolean isEmpty(com.agilex.healthcare.schedulingmanager.mdws.generatedwsdl.queryservice.TextArray textArray) {
        if (null != textArray && null != textArray.getText() && null != textArray.getText().getString() && textArray.getText().getString().size() > 0) {
            return false;
        }
        return true;
    }
}
