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

Alachisoft.NCache.Common.Monitoring.Counters Maven / Gradle / Ivy

There is a newer version: 5.3.3
Show newest version
package Alachisoft.NCache.Common.Monitoring;

import Alachisoft.NCache.Common.Common;
import Alachisoft.NCache.Common.Configuration.ConfigurationRootAnnotation;
import Alachisoft.NCache.Common.Configuration.ConfigurationSectionAnnotation;
import Alachisoft.NCache.Common.ICloneable;
import com.alachisoft.ncache.serialization.core.io.ICompactSerializable;
import com.alachisoft.ncache.serialization.core.io.InternalCompactSerializable;
import com.alachisoft.ncache.serialization.core.io.NCacheObjectInput;
import com.alachisoft.ncache.serialization.core.io.NCacheObjectOutput;
import com.alachisoft.ncache.serialization.standard.io.CompactReader;
import com.alachisoft.ncache.serialization.standard.io.CompactWriter;

import java.io.IOException;
@ConfigurationRootAnnotation("counters")
public class Counters implements ICloneable, InternalCompactSerializable
{
    private java.util.ArrayList _category;
    public Counters()
    {

    }
@ConfigurationSectionAnnotation("category")
    public Category[] getCategory()
    {
        if (_category != null) {
            return _category.toArray(new Category[0]);
        }
        return null;
    }
    @ConfigurationSectionAnnotation("category")
    public  void setCategory(Object value)
    {
        if (_category == null) {
           _category = new java.util.ArrayList();
        }


        if (value != null) {
            Object[] objs = (Object[]) value;
            for (int i = 0; i < objs.length; i++) {
                _category.add((Category) objs[i]);
            }


        }
    }
    @Override
    public Object clone() {
        Counters counters = new Counters();
        counters.setCategory(_category);
        return counters;
    }


    @Override
    public void Deserialize(CompactReader reader) throws IOException, ClassNotFoundException
    {
       setCategory(Common.as(reader.ReadObject(), Category[].class));
    }

    @Override
    public void Serialize(CompactWriter writer) throws IOException
    {
            writer.WriteObject(getCategory());
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy