All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.zeroc.IceMX.MetricsFailuresSeqHelper Maven / Gradle / Ivy

//
// Copyright (c) ZeroC, Inc. All rights reserved.
//
//
// Ice version 3.7.2
//
// 
//
// Generated from file `Metrics.ice'
//
// Warning: do not edit this file.
//
// 
//

package com.zeroc.IceMX;

/**
 * Helper class for marshaling/unmarshaling MetricsFailuresSeq.
 **/
public final class MetricsFailuresSeqHelper
{
    public static void write(com.zeroc.Ice.OutputStream ostr, MetricsFailures[] v)
    {
        if(v == null)
        {
            ostr.writeSize(0);
        }
        else
        {
            ostr.writeSize(v.length);
            for(int i0 = 0; i0 < v.length; i0++)
            {
                MetricsFailures.ice_write(ostr, v[i0]);
            }
        }
    }

    public static MetricsFailures[] read(com.zeroc.Ice.InputStream istr)
    {
        final MetricsFailures[] v;
        final int len0 = istr.readAndCheckSeqSize(2);
        v = new MetricsFailures[len0];
        for(int i0 = 0; i0 < len0; i0++)
        {
            v[i0] = MetricsFailures.ice_read(istr);
        }
        return v;
    }

    public static void write(com.zeroc.Ice.OutputStream ostr, int tag, java.util.Optional v)
    {
        if(v != null && v.isPresent())
        {
            write(ostr, tag, v.get());
        }
    }

    public static void write(com.zeroc.Ice.OutputStream ostr, int tag, MetricsFailures[] v)
    {
        if(ostr.writeOptional(tag, com.zeroc.Ice.OptionalFormat.FSize))
        {
            int pos = ostr.startSize();
            MetricsFailuresSeqHelper.write(ostr, v);
            ostr.endSize(pos);
        }
    }

    public static java.util.Optional read(com.zeroc.Ice.InputStream istr, int tag)
    {
        if(istr.readOptional(tag, com.zeroc.Ice.OptionalFormat.FSize))
        {
            istr.skip(4);
            MetricsFailures[] v;
            v = MetricsFailuresSeqHelper.read(istr);
            return java.util.Optional.of(v);
        }
        else
        {
            return java.util.Optional.empty();
        }
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy