Example usage for com.google.gson JsonArray size

List of usage examples for com.google.gson JsonArray size

Introduction

In this page you can find the example usage for com.google.gson JsonArray size.

Prototype

public int size() 

Source Link

Document

Returns the number of elements in the array.

Usage

From source file:com.addthis.hydra.task.source.bundleizer.GsonBundleizer.java

License:Apache License

public ValueObject fromGson(JsonElement gson) {
    if (gson.isJsonNull()) {
        return null;
    } else if (gson.isJsonObject()) {
        JsonObject object = gson.getAsJsonObject();
        ValueMap map = ValueFactory.createMap();
        for (Map.Entry<String, JsonElement> entry : object.entrySet()) {
            map.put(entry.getKey(), fromGson(entry.getValue()));
        }//  w  ww.j  a  va  2 s .com
        return map;
    } else if (gson.isJsonArray()) {
        JsonArray gsonArray = gson.getAsJsonArray();
        ValueArray valueArray = ValueFactory.createArray(gsonArray.size());
        for (JsonElement arrayElement : gsonArray) {
            valueArray.add(fromGson(arrayElement));
        }
        return valueArray;
    } else {
        JsonPrimitive primitive = gson.getAsJsonPrimitive();
        if (primitive.isNumber()) {
            return ValueFactory.create(primitive.getAsDouble());
        } else {
            return ValueFactory.create(primitive.getAsString());
        }
    }
}

From source file:com.adobe.acs.commons.audit_log_search.impl.AuditLogSearchServlet.java

License:Apache License

private JsonObject serializeAuditEvent(Resource auditEventResource, AuditLogSearchRequest request)
        throws RepositoryException, IOException, ClassNotFoundException {
    JsonObject auditEvent = new JsonObject();
    ValueMap properties = auditEventResource.getValueMap();
    auditEvent.addProperty("category", properties.get("cq:category", String.class));
    auditEvent.addProperty("eventPath", auditEventResource.getPath());
    auditEvent.addProperty("path", properties.get("cq:path", String.class));
    auditEvent.addProperty("type", properties.get("cq:type", String.class));
    String userId = properties.get("cq:userid", String.class);
    auditEvent.addProperty("userId", userId);
    auditEvent.addProperty("userName", request.getUserName(auditEventResource.getResourceResolver(), userId));
    auditEvent.addProperty("userPath", request.getUserPath(auditEventResource.getResourceResolver(), userId));
    auditEvent.addProperty("time", properties.get("cq:time", new Date()).getTime());

    JsonArray modified = getModifiedProperties(properties);
    if (properties.get("above", String.class) != null) {
        modified.add(new JsonPrimitive("above=" + properties.get("above", String.class)));
    }// w  w w  .  jav a  2s  . c  o  m
    if (properties.get("destination", String.class) != null) {
        modified.add(new JsonPrimitive("destination=" + properties.get("destination", String.class)));
    }
    if (properties.get("versionId", String.class) != null) {
        modified.add(new JsonPrimitive("versionId=" + properties.get("versionId", String.class)));
    }
    if (modified.size() != 0) {
        auditEvent.add("modified", modified);
    }

    return auditEvent;
}

From source file:com.adobe.acs.commons.dam.audio.watson.impl.TranscriptionServiceImpl.java

License:Apache License

@Override
public Result getResult(String jobId) {
    log.debug("getting result for {}", jobId);
    Request request = httpClientFactory.get("/speech-to-text/api/v1/recognitions/" + jobId);
    try {/* w ww  .  j a  v a2  s  . co m*/
        JsonObject json = (JsonObject) httpClientFactory.getExecutor().execute(request).handleResponse(HANDLER);

        Gson gson = new Gson();
        log.trace("content: {}", gson.toJson(json));
        if (json.has("status") && json.get("status").getAsString().equals("completed")) {
            JsonArray results = json.get("results").getAsJsonArray().get(0).getAsJsonObject().get("results")
                    .getAsJsonArray();
            StringBuilder builder = new StringBuilder();
            for (int i = 0; i < results.size(); i++) {
                JsonObject result = results.get(i).getAsJsonObject();
                if (result.get("final").getAsBoolean()) {
                    JsonObject firstAlternative = result.get("alternatives").getAsJsonArray().get(0)
                            .getAsJsonObject();
                    String line = firstAlternative.get("transcript").getAsString();
                    if (StringUtils.isNotBlank(line)) {
                        double firstTimestamp = firstAlternative.get("timestamps").getAsJsonArray().get(0)
                                .getAsJsonArray().get(1).getAsDouble();
                        builder.append("[").append(firstTimestamp).append("s]: ").append(line).append("\n");
                    }
                }
            }

            String concatenated = builder.toString();
            concatenated = concatenated.replace("%HESITATION ", "");

            return new ResultImpl(true, concatenated);
        } else {
            return new ResultImpl(false, null);
        }
    } catch (IOException e) {
        log.error("Unable to get result. assuming failure.", e);
        return new ResultImpl(true, "error");
    }

}

From source file:com.adobe.acs.commons.exporters.impl.users.Parameters.java

License:Apache License

public Parameters(SlingHttpServletRequest request) throws IOException {
    final JsonObject json = new JsonParser().parse(request.getParameter("params")).getAsJsonObject();

    final List<String> tmpCustomProperties = new ArrayList<String>();
    final List<String> tmpGroups = new ArrayList<String>();

    groupFilter = getString(json, GROUP_FILTER);

    JsonArray groupsJSON = json.getAsJsonArray(GROUPS);
    for (int i = 0; i < groupsJSON.size(); i++) {
        tmpGroups.add(groupsJSON.get(i).getAsString());
    }/* w ww  .  j  ava2  s.  c  o  m*/

    this.groups = tmpGroups.toArray(new String[tmpGroups.size()]);

    JsonArray customPropertiesJSON = json.getAsJsonArray(CUSTOM_PROPERTIES);
    for (int i = 0; i < customPropertiesJSON.size(); i++) {
        JsonObject tmp = customPropertiesJSON.get(i).getAsJsonObject();

        if (tmp.has(RELATIVE_PROPERTY_PATH)) {
            String relativePropertyPath = getString(tmp, RELATIVE_PROPERTY_PATH);
            tmpCustomProperties.add(relativePropertyPath);
        }
    }

    this.customProperties = tmpCustomProperties.toArray(new String[tmpCustomProperties.size()]);
}

From source file:com.adobe.acs.commons.json.AbstractJSONObjectVisitor.java

License:Apache License

/**
 * Visit each JSON Object in the JSON Array.
 *
 * @param jsonArray The JSON Array/*from   www.j a v a 2 s .  com*/
 */
protected final void traverseJSONArray(final JsonArray jsonArray) {
    if (jsonArray == null) {
        return;
    }

    for (int i = 0; i < jsonArray.size(); i++) {
        if (jsonArray.get(i).isJsonObject()) {
            this.accept(jsonArray.get(i).getAsJsonObject());
        } else if (jsonArray.get(i).isJsonArray()) {
            this.accept(jsonArray.get(i).getAsJsonArray());
        }
    }
}

From source file:com.adobe.acs.commons.remoteassets.impl.RemoteAssetsNodeSyncImpl.java

License:Apache License

/**
 * Set generic array property for a resource, based on an array found in the retrieved JSON.
 *
 * @param jsonArray JsonArray/*  w  w  w. j a  v a  2 s.co  m*/
 * @param key String
 * @param resource Resource
 * @throws RepositoryException exception
 */
private void setNodeSimpleArrayProperty(final JsonArray jsonArray, final String key, final Resource resource)
        throws RepositoryException {
    JsonPrimitive firstVal = jsonArray.get(0).getAsJsonPrimitive();

    try {
        Object[] values;
        if (firstVal.isBoolean()) {
            values = new Boolean[jsonArray.size()];
            for (int i = 0; i < jsonArray.size(); i++) {
                values[i] = jsonArray.get(i).getAsBoolean();
            }
        } else if (DECIMAL_REGEX.matcher(firstVal.getAsString()).matches()) {
            values = new BigDecimal[jsonArray.size()];
            for (int i = 0; i < jsonArray.size(); i++) {
                values[i] = jsonArray.get(i).getAsBigDecimal();
            }
        } else if (firstVal.isNumber()) {
            values = new Long[jsonArray.size()];
            for (int i = 0; i < jsonArray.size(); i++) {
                values[i] = jsonArray.get(i).getAsLong();
            }
        } else {
            values = new String[jsonArray.size()];
            for (int i = 0; i < jsonArray.size(); i++) {
                values[i] = jsonArray.get(i).getAsString();
            }
        }

        ValueMap resourceProperties = resource.adaptTo(ModifiableValueMap.class);
        resourceProperties.put(key, values);
        LOG.trace("Array property '{}' added for resource '{}'", key, resource.getPath());
    } catch (Exception e) {
        LOG.error("Unable to assign property '{}' to resource '{}'", key, resource.getPath(), e);
    }
}

From source file:com.adobe.acs.commons.workflow.bulk.removal.impl.servlets.RemoveServlet.java

License:Apache License

@Override
public final void doPost(SlingHttpServletRequest request, SlingHttpServletResponse response)
        throws ServletException, IOException {

    response.setContentType("application/json");
    response.setCharacterEncoding("UTF-8");

    List<String> statuses = new ArrayList<>();
    List<String> models = new ArrayList<>();
    List<Pattern> payloads = new ArrayList<>();
    Calendar olderThan = null;/*from  ww w.  ja v  a  2s . co m*/

    try {
        JsonObject params = toJsonObject(request.getParameter("params"));

        JsonArray jsonArray = params.getAsJsonArray(PARAM_WORKFLOW_STATUSES);
        for (int i = 0; i < jsonArray.size(); i++) {
            statuses.add(jsonArray.get(i).getAsString());
        }

        jsonArray = params.getAsJsonArray(PARAM_WORKFLOW_MODELS);
        for (int i = 0; i < jsonArray.size(); i++) {
            models.add(jsonArray.get(i).getAsString());
        }

        jsonArray = params.getAsJsonArray(PARAM_WORKFLOW_PAYLOADS);
        for (int i = 0; i < jsonArray.size(); i++) {
            final JsonObject tmp = jsonArray.get(i).getAsJsonObject();
            final String pattern = getString(tmp, "pattern");

            if (StringUtils.isNotBlank(pattern)) {
                payloads.add(Pattern.compile(pattern));
            }
        }

        final Long ts = getLong(params, PARAM_OLDER_THAN);
        if (ts != null && ts > 0) {
            olderThan = Calendar.getInstance();
            olderThan.setTimeInMillis(ts * MS_IN_SECOND);
        }

        int batchSize = getInteger(params, PARAM_BATCH_SIZE);
        if (batchSize < 1) {
            batchSize = DEFAULT_BATCH_SIZE;
        }

        int maxDuration = getInteger(params, PARAM_MAX_DURATION);
        if (maxDuration < 1) {
            maxDuration = DEFAULT_MAX_DURATION;
        }

        workflowInstanceRemover.removeWorkflowInstances(request.getResourceResolver(), models, statuses,
                payloads, olderThan, batchSize, maxDuration);

    } catch (WorkflowRemovalForceQuitException e) {
        response.setStatus(599);
        response.getWriter().write("Workflow removal force quit");

    } catch (Exception e) {
        log.error("An error occurred while attempting to remove workflow instances.", e);

        response.setStatus(SlingHttpServletResponse.SC_INTERNAL_SERVER_ERROR);

        if (response.getWriter() != null) {
            response.getWriter().write(e.getMessage());
        }
    }
}

From source file:com.agwego.fuzz.FuzzTestCase.java

License:Open Source License

@SuppressWarnings("unchecked method invocation: <T>fromJson(com.google.gson.JsonElement,java.lang.Class<T>) in com.google.gson.Gson is applied to (com.google.gson.Jon: <T>fromJson(com.google.gson.JsonElement,java.lang.Class<T>) in com.google.gson.Gson is applied to (com.google.gson.J")
protected static FuzzTestCase deserialize(final JsonObject jobj, final int testNumber, final String methodName,
        final Class testClass) throws FuzzTestJsonError {
    FuzzTestCase fuzzTestCase = new FuzzTestCase();
    fuzzTestCase.setMethodName(methodName);
    fuzzTestCase.setNumber(testNumber);//www .  j  a  v  a  2s. co  m
    fuzzTestCase.setMessage(GsonHelper.getAsString(jobj, "comment"));
    fuzzTestCase.setExceptionThrown(GsonHelper.getAsString(jobj, "exceptionThrown"));
    fuzzTestCase.setExceptionMessage(GsonHelper.getAsString(jobj, "exceptionMessage"));
    fuzzTestCase.setSkip(GsonHelper.getAsBoolean(jobj, "skip", false));
    fuzzTestCase.setPass(GsonHelper.getAsBoolean(jobj, "pass", true));
    fuzzTestCase.setTestName(GsonHelper.getAsString(jobj, "name", ""));

    JsonArray jargs;
    try {
        jargs = jobj.getAsJsonArray("args");
    } catch (ClassCastException ex) {
        throw new FuzzTestJsonError(String.format("Method '%s' argument list must be an array", methodName),
                ex);
    }
    if (jargs == null || jargs.size() == 0) {
        throw new FuzzTestJsonError(String.format("Method '%s' has no argument list", methodName));
    }
    Class params[];
    try {
        params = getMethodParams(testClass, methodName, jargs.size());
    } catch (FuzzTestJsonError ex) {
        throw new FuzzTestJsonError(ex.getMessage());
    }

    int idx = 0;
    for (JsonElement jarg : jargs) {
        fuzzTestCase.addArg(createArg(jarg, params[idx]));
        idx++;
    }

    return fuzzTestCase;
}

From source file:com.aliyun.odps.udf.utils.CounterUtils.java

License:Apache License

private static void fromJson(CounterGroup group, JsonObject obj) {
    JsonArray counterArray = obj.get("counters").getAsJsonArray();
    for (int i = 0; i < counterArray.size(); i++) {
        JsonObject subObj = counterArray.get(i).getAsJsonObject();
        String counterName = subObj.get("name").getAsString();
        Counter counter = group.findCounter(counterName);
        long value = subObj.get("value").getAsLong();
        counter.increment(value);// w  ww  . java 2  s  .c  o m
    }
}

From source file:com.amsterdam.marktbureau.makkelijkemarkt.DagvergunningFragment.java

License:Mozilla Public License

/**
 * Populate overzicht fragment from local member vars
 *//*from   ww  w  .  j ava  2 s.  c o  m*/
private void populateOverzichtFragment() {
    if (mOverzichtFragmentReady) {

        // TODO: show the changes in case we are editing an existing dagvergunning

        // koopman
        if (mKoopmanId > 0) {
            mOverzichtFragment.mKoopmanLinearLayout.setVisibility(View.VISIBLE);
            mOverzichtFragment.mKoopmanEmptyTextView.setVisibility(View.GONE);

            // koopman details
            mOverzichtFragment.setKoopman(mKoopmanId);

            // dagvergunning registratie tijd
            if (mRegistratieDatumtijd != null) {
                try {
                    Date registratieDate = new SimpleDateFormat(getString(R.string.date_format_datumtijd),
                            Locale.getDefault()).parse(mRegistratieDatumtijd);
                    SimpleDateFormat sdf = new SimpleDateFormat(getString(R.string.date_format_tijd));
                    String registratieTijd = sdf.format(registratieDate);
                    mOverzichtFragment.mRegistratieDatumtijdText.setText(registratieTijd);
                } catch (java.text.ParseException e) {
                    Utility.log(getContext(), LOG_TAG, "Format registratie tijd failed: " + e.getMessage());
                }
            } else {
                mOverzichtFragment.mRegistratieDatumtijdText.setText("");
            }

            // dagvergunning notitie
            if (mNotitie != null && !mNotitie.equals("")) {
                mOverzichtFragment.mNotitieText.setText(getString(R.string.label_notitie) + ": " + mNotitie);
                Utility.collapseView(mOverzichtFragment.mNotitieText, false);
            } else {
                Utility.collapseView(mOverzichtFragment.mNotitieText, true);
            }

            // dagvergunning totale lengte
            if (mTotaleLengte != -1) {
                mOverzichtFragment.mTotaleLengte
                        .setText(mTotaleLengte + " " + getString(R.string.length_meter));
            }

            // registratie account naam
            if (mRegistratieAccountNaam != null) {
                mOverzichtFragment.mAccountNaam.setText(mRegistratieAccountNaam);
            } else {
                mOverzichtFragment.mAccountNaam.setText("");
            }

            // koopman aanwezig status
            if (mKoopmanAanwezig != null) {

                // get the corresponding aanwezig title from the resource array based on the aanwezig key
                String[] aanwezigKeys = getResources().getStringArray(R.array.array_aanwezig_key);
                String[] aanwezigTitles = getResources().getStringArray(R.array.array_aanwezig_title);
                String aanwezigTitle = "";
                for (int i = 0; i < aanwezigKeys.length; i++) {
                    if (aanwezigKeys[i].equals(mKoopmanAanwezig)) {
                        aanwezigTitle = aanwezigTitles[i];
                    }
                }
                mOverzichtFragment.mAanwezigText.setText(aanwezigTitle);
            }

            // vervanger
            if (mVervangerId > 0) {

                // hide the aanwezig status and populate and show the vervanger details
                mOverzichtFragment.mAanwezigText.setVisibility(View.GONE);
                mOverzichtFragment.mVervangerDetail.setVisibility(View.VISIBLE);
                mOverzichtFragment.setVervanger(mVervangerId);
            } else {

                // show the aanwezig status and hide the vervanger details
                mOverzichtFragment.mAanwezigText.setVisibility(View.VISIBLE);
                mOverzichtFragment.mVervangerDetail.setVisibility(View.GONE);
            }
        } else {
            mOverzichtFragment.mKoopmanEmptyTextView.setVisibility(View.VISIBLE);
            mOverzichtFragment.mKoopmanLinearLayout.setVisibility(View.GONE);
        }

        // product
        if (mErkenningsnummer != null && isProductSelected()) {

            // show progress bar
            mProgressbar.setVisibility(View.VISIBLE);

            // disable save function until we have a response from the api for a concept factuur
            mConceptFactuurDownloaded = false;

            // post the dagvergunning details to the api and retrieve a concept 'factuur'
            ApiPostDagvergunningConcept postDagvergunningConcept = new ApiPostDagvergunningConcept(
                    getContext());
            postDagvergunningConcept.setPayload(dagvergunningToJson());
            postDagvergunningConcept.enqueue(new Callback<JsonObject>() {
                @Override
                public void onResponse(Response<JsonObject> response) {

                    // hide progress bar
                    mProgressbar.setVisibility(View.GONE);

                    if (response.isSuccess() && response.body() != null) {
                        mOverzichtFragment.mProductenLinearLayout.setVisibility(View.VISIBLE);
                        mOverzichtFragment.mProductenEmptyTextView.setVisibility(View.GONE);

                        // enable save function and give wizard next button background enabled color
                        mConceptFactuurDownloaded = true;
                        mWizardNextButton
                                .setBackgroundColor(ContextCompat.getColor(getContext(), R.color.accent));

                        // from the response, populate the product section of the overzicht fragment
                        View overzichtView = mOverzichtFragment.getView();
                        if (overzichtView != null) {

                            // find placeholder table layout view
                            TableLayout placeholderLayout = (TableLayout) overzichtView
                                    .findViewById(R.id.producten_placeholder);
                            if (placeholderLayout != null) {
                                placeholderLayout.removeAllViews();
                                LayoutInflater layoutInflater = (LayoutInflater) getActivity()
                                        .getSystemService(Context.LAYOUT_INFLATER_SERVICE);

                                // get the producten array
                                JsonArray producten = response.body().getAsJsonArray(getString(
                                        R.string.makkelijkemarkt_api_dagvergunning_concept_producten));

                                if (producten != null) {
                                    int rowCount = 0;

                                    // table header
                                    View headerLayout = layoutInflater
                                            .inflate(R.layout.dagvergunning_overzicht_product_item, null);
                                    TextView btwHeaderText = (TextView) headerLayout
                                            .findViewById(R.id.btw_totaal);
                                    btwHeaderText.setText("BTW");
                                    TextView exclusiefHeaderText = (TextView) headerLayout
                                            .findViewById(R.id.bedrag_totaal);
                                    exclusiefHeaderText.setText("Ex. BTW");
                                    placeholderLayout.addView(headerLayout, rowCount++);

                                    for (int i = 0; i < producten.size(); i++) {
                                        JsonObject product = producten.get(i).getAsJsonObject();

                                        // get the product item layout
                                        View childLayout = layoutInflater
                                                .inflate(R.layout.dagvergunning_overzicht_product_item, null);

                                        // aantal
                                        if (product.get("aantal") != null
                                                && !product.get("aantal").isJsonNull()) {
                                            TextView aantalText = (TextView) childLayout
                                                    .findViewById(R.id.product_aantal);
                                            aantalText.setText(product.get("aantal").getAsInt() + " x ");
                                        }

                                        // naam
                                        if (product.get("naam") != null && !product.get("naam").isJsonNull()) {
                                            TextView naamText = (TextView) childLayout
                                                    .findViewById(R.id.product_naam);
                                            naamText.setText(
                                                    Utility.capitalize(product.get("naam").getAsString()));
                                        }

                                        // btw %
                                        if (product.get("btw_percentage") != null
                                                && !product.get("btw_percentage").isJsonNull()) {
                                            long btwPercentage = Math.round(Double
                                                    .parseDouble(product.get("btw_percentage").getAsString()));
                                            if (btwPercentage != 0) {
                                                TextView btwPercentageText = (TextView) childLayout
                                                        .findViewById(R.id.btw_percentage);
                                                btwPercentageText.setText(btwPercentage + "%");
                                            }
                                        }

                                        // btw totaal
                                        if (product.get("btw_totaal") != null
                                                && !product.get("btw_totaal").isJsonNull()) {
                                            double btwTotaalProduct = Double
                                                    .parseDouble(product.get("btw_totaal").getAsString());
                                            TextView btwTotaalText = (TextView) childLayout
                                                    .findViewById(R.id.btw_totaal);
                                            if (Math.round(btwTotaalProduct) != 0) {
                                                btwTotaalText
                                                        .setText(String.format(" %.2f", btwTotaalProduct));
                                            } else {
                                                btwTotaalText.setText("-");
                                            }
                                        }

                                        // bedrag totaal
                                        if (product.get("totaal") != null
                                                && !product.get("totaal").isJsonNull()) {
                                            double bedragTotaal = Double
                                                    .parseDouble(product.get("totaal").getAsString());
                                            TextView bedragTotaalText = (TextView) childLayout
                                                    .findViewById(R.id.bedrag_totaal);
                                            bedragTotaalText.setText(String.format(" %.2f", bedragTotaal));
                                        }

                                        // add child view
                                        placeholderLayout.addView(childLayout, rowCount++);
                                    }

                                    // exclusief
                                    double exclusief = 0;
                                    if (response.body().get("exclusief") != null
                                            && !response.body().get("exclusief").isJsonNull()) {
                                        exclusief = Double
                                                .parseDouble(response.body().get("exclusief").getAsString());
                                    }

                                    // totaal
                                    double totaal = 0;
                                    if (response.body().get("totaal") != null
                                            && !response.body().get("totaal").isJsonNull()) {
                                        totaal = response.body().get("totaal").getAsDouble();
                                    }

                                    // totaal btw en ex. btw
                                    View totaalLayout = layoutInflater
                                            .inflate(R.layout.dagvergunning_overzicht_product_item, null);
                                    TextView naamText = (TextView) totaalLayout.findViewById(R.id.product_naam);
                                    naamText.setText("Totaal");
                                    TextView btwTotaalText = (TextView) totaalLayout
                                            .findViewById(R.id.btw_totaal);
                                    if (Math.round(totaal - exclusief) != 0) {
                                        btwTotaalText.setText(String.format(" %.2f", (totaal - exclusief)));
                                    }
                                    TextView exclusiefText = (TextView) totaalLayout
                                            .findViewById(R.id.bedrag_totaal);
                                    exclusiefText.setText(String.format(" %.2f", exclusief));
                                    placeholderLayout.addView(totaalLayout, rowCount++);

                                    // separator
                                    View emptyLayout = layoutInflater
                                            .inflate(R.layout.dagvergunning_overzicht_product_item, null);
                                    placeholderLayout.addView(emptyLayout, rowCount++);

                                    // totaal inc. btw
                                    View totaalIncLayout = layoutInflater
                                            .inflate(R.layout.dagvergunning_overzicht_product_item, null);
                                    TextView totaalNaamText = (TextView) totaalIncLayout
                                            .findViewById(R.id.product_naam);
                                    totaalNaamText.setText("Totaal inc. BTW");
                                    TextView totaalIncText = (TextView) totaalIncLayout
                                            .findViewById(R.id.bedrag_totaal);
                                    totaalIncText.setText(String.format(" %.2f", totaal));
                                    placeholderLayout.addView(totaalIncLayout, rowCount);
                                }
                            }
                        }
                    }
                }

                @Override
                public void onFailure(Throwable t) {
                    mProgressbar.setVisibility(View.GONE);
                }
            });
        } else {
            mOverzichtFragment.mProductenLinearLayout.setVisibility(View.GONE);

            if (mKoopmanId > 0) {
                mOverzichtFragment.mProductenEmptyTextView.setVisibility(View.VISIBLE);
            }
        }
    }
}