Package framework.beans

Source Code of framework.beans.ModificationInfo

/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/

package framework.beans;

import framework.audit.AuditDetails;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;

/**
*
* @author axe
*/
public class ModificationInfo implements Serializable {
    private final int id;
    private final List<AuditDetails> audit;

    public ModificationInfo(int id, List<AuditDetails> audit) {
        Iterator<AuditDetails> iterator = audit.iterator();
        for (Iterator<AuditDetails> it = audit.iterator(); it.hasNext();) {
            AuditDetails auditDetails = it.next();
            if (auditDetails == null) {
                it.remove();
            }
        }
        this.id = id;
        this.audit = audit;
    }

    public ModificationInfo(AuditDetails auditDetails) {
        this.audit = new ArrayList<AuditDetails>(1);
        if (auditDetails != null) {
            this.id = auditDetails.getEntityId;
            this.audit.add(auditDetails);
        } else {
            this.id = 0;
        }
    }

    public ModificationInfo(int id, AuditDetails auditDetails) {
        this.audit = new ArrayList<AuditDetails>(1);
        if (auditDetails != null) {
            this.audit.add(auditDetails);
        }
        this.id = id;
    }


    public int getId() {
        return id;
    }

    public List<AuditDetails> getAudit() {
        return audit;
    }


}
TOP

Related Classes of framework.beans.ModificationInfo

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.