63 lines
1.5 KiB
Java
63 lines
1.5 KiB
Java
|
package envoy.server.data;
|
||
|
|
||
|
import javax.persistence.GeneratedValue;
|
||
|
import javax.persistence.GenerationType;
|
||
|
import javax.persistence.Id;
|
||
|
import javax.persistence.MappedSuperclass;
|
||
|
|
||
|
/**
|
||
|
* This class acts as a superclass for all contacts, being {@link User}s and
|
||
|
* {@link Group}s. <br>
|
||
|
* <br>
|
||
|
* Project: <strong>envoy-server-standalone</strong><br>
|
||
|
* File: <strong>Contact.java</strong><br>
|
||
|
* Created: <strong>24.03.2020</strong><br>
|
||
|
*
|
||
|
* @author Maximilian Käfer
|
||
|
* @since Envoy Server Standalone v0.1-alpha
|
||
|
*/
|
||
|
|
||
|
@MappedSuperclass
|
||
|
// TODO add queries
|
||
|
public abstract class Contact {
|
||
|
|
||
|
@Id
|
||
|
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||
|
protected long id;
|
||
|
protected String name;
|
||
|
|
||
|
/**
|
||
|
* @return a envoy.data.Contact object of this envoy.server.data.Contact object.
|
||
|
* @since Envoy Server Standalone v0.1-beta
|
||
|
*/
|
||
|
public abstract envoy.data.Contact toCommon();
|
||
|
|
||
|
/**
|
||
|
* @return the ID of this contact.
|
||
|
* @since Envoy Server Standalone v0.1-beta
|
||
|
*/
|
||
|
public long getID() { return id; }
|
||
|
|
||
|
/**
|
||
|
* Sets the ID of this contact.
|
||
|
*
|
||
|
* @param id to set for this contact
|
||
|
* @since Envoy Server Standalone v0.1-beta
|
||
|
*/
|
||
|
public void setID(long id) { this.id = id; }
|
||
|
|
||
|
/**
|
||
|
* @return the name of this contact.
|
||
|
* @since Envoy Server Standalone v0.1-beta
|
||
|
*/
|
||
|
public String getName() { return name; }
|
||
|
|
||
|
/**
|
||
|
* Sets the name of this contact.
|
||
|
*
|
||
|
* @param name to set for this contact
|
||
|
* @since Envoy Server Standalone v0.1-beta
|
||
|
*/
|
||
|
public void setName(String name) { this.name = name; }
|
||
|
}
|