update verigraph
[parser.git] / verigraph / src / it / polito / verigraph / model / Neighbour.java
1 /*******************************************************************************
2  * Copyright (c) 2017 Politecnico di Torino and others.
3  *
4  * All rights reserved. This program and the accompanying materials
5  * are made available under the terms of the Apache License, Version 2.0
6  * which accompanies this distribution, and is available at
7  * http://www.apache.org/licenses/LICENSE-2.0
8  *******************************************************************************/
9 package it.polito.verigraph.model;
10
11 import javax.xml.bind.annotation.XmlTransient;
12
13 import io.swagger.annotations.ApiModel;
14 import io.swagger.annotations.ApiModelProperty;
15
16 @ApiModel(value = "Neighbour")
17 public class Neighbour {
18
19     @ApiModelProperty(required = false, hidden = true)
20     @XmlTransient
21     private long id;
22
23     @ApiModelProperty(required = true,
24             example = "nat",
25             value = "The neighbour name must refer to an existing node of the same graph")
26     private String name;
27
28     public Neighbour() {
29
30     }
31
32     public Neighbour(long id, String name) {
33         this.id = id;
34         this.name = name;
35     }
36
37     public long getId() {
38         return id;
39     }
40
41     public void setId(long id) {
42         this.id = id;
43     }
44
45     public String getName() {
46         return name;
47     }
48
49     public void setName(String name) {
50         this.name = name;
51     }
52
53     @Override
54     public int hashCode() {
55         final int prime = 31;
56         int result = 1;
57         result = prime * result + ((name == null) ? 0 : name.hashCode());
58         return result;
59     }
60
61     @Override
62     public boolean equals(Object obj) {
63         if (this == obj)
64             return true;
65         else
66             return false;
67     }
68
69 }