package com.pack.modeler.model;

import lombok.Data;

import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;

@Entity
@Data
public class DiagramData {
    @Id
    @GeneratedValue
    Long id;

    String token;
    String link;

    int traces;
    int nodes;
    double density;
    double cohesion;
    double coupling;
    double cnc;

    public static DiagramData of(String tokenKey,
                                 String link,
                                 int traces,
                                 int nodes,
                                 double density,
                                 double cohesion,
                                 double coupling,
                                 double cnc) {
        DiagramData bd = new DiagramData();
        bd.token = tokenKey;
        bd.link = link;

        bd.traces = traces;

        bd.nodes = nodes;
        bd.density = density;
        bd.cohesion = cohesion;
        bd.coupling = coupling;
        bd.cnc = cnc;

        return bd;
    }

}