Alachisoft.NCache.Common.Monitoring.Counters Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of nc-common Show documentation
Show all versions of nc-common Show documentation
Internal package of Alachisoft.
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());
}
}