HostIdentity.java 822 Bytes
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36
package adt.mainnode.identity;

import lombok.Data;
import lombok.NoArgsConstructor;

import javax.persistence.Column;
import javax.persistence.Embeddable;
import javax.persistence.Id;
import java.io.Serializable;

@Embeddable
@Data
@NoArgsConstructor
public class HostIdentity implements Serializable {

    @Id
    @Column(name = "ip")
    private String ip;

    @Id
    @Column(name = "vlan_name")
    private String vlanName;

    @Id
    @Column(name = "snapshotId")
    private String snapshotId;

    public static HostIdentity createHostIdentity(String ip, String vlanName, String snapshotId) {
        HostIdentity hostIdentity = new HostIdentity();
        hostIdentity.setIp(ip);
        hostIdentity.setVlanName(vlanName);
        hostIdentity.setSnapshotId(snapshotId);
        return hostIdentity;
    }

}