001/*
002 * (C) Copyright 2014 Nuxeo SA (http://nuxeo.com/) and others.
003 *
004 * Licensed under the Apache License, Version 2.0 (the "License");
005 * you may not use this file except in compliance with the License.
006 * You may obtain a copy of the License at
007 *
008 *     http://www.apache.org/licenses/LICENSE-2.0
009 *
010 * Unless required by applicable law or agreed to in writing, software
011 * distributed under the License is distributed on an "AS IS" BASIS,
012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
013 * See the License for the specific language governing permissions and
014 * limitations under the License.
015 *
016 * Contributors:
017 *     <a href="mailto:grenard@nuxeo.com">Guillaume</a>
018 */
019package org.nuxeo.ecm.platform.sessioninspector.jsf.model;
020
021/**
022 * Might be useful to check for references stats (in case same object is referenced in several items state).
023 *
024 * @since 5.9.2
025 */
026public class ObjectStatistics {
027
028    private String type;
029
030    private long nbInstance;
031
032    private long cumulatedSize;
033
034    /**
035     * @param type
036     * @param nbObject
037     * @param cumulatedSize
038     */
039    public ObjectStatistics(String type, long nbInstance, long cumulatedSize) {
040        super();
041        this.type = type;
042        this.nbInstance = nbInstance;
043        this.cumulatedSize = cumulatedSize;
044    }
045
046    /**
047     * @param type
048     * @param nbObject
049     * @param cumulatedSize
050     */
051    public ObjectStatistics(String type) {
052        this(type, 1, 0);
053    }
054
055    public String getType() {
056        return type;
057    }
058
059    public void setType(String type) {
060        this.type = type;
061    }
062
063    public long getNbInstance() {
064        return nbInstance;
065    }
066
067    public void setNbInstance(long nbInstance) {
068        this.nbInstance = nbInstance;
069    }
070
071    public long getCumulatedSize() {
072        return cumulatedSize;
073    }
074
075    public void setCumulatedSize(long cumulatedSize) {
076        this.cumulatedSize = cumulatedSize;
077    }
078
079}