This repository has been archived on 2021-12-05. You can view files and clone it, but cannot push or open issues or pull requests.
envoy/src/main/java/envoy/data/Contact.java

59 lines
1.3 KiB
Java
Raw Normal View History

package envoy.data;
import java.io.Serializable;
/**
* This class is the superclass for both {@link User} and {@link Group}.<br>
* It provides an id and a name for each user and group.<br>
* <br>
* Project: <strong>envoy-common</strong><br>
* File: <strong>Contact.java</strong><br>
* Created: <strong>24 Mar 2020</strong><br>
*
* @author Leon Hofmeister
* @since Envoy v0.1-beta
*/
public abstract class Contact implements Serializable {
private final long id;
private String name;
private static final long serialVersionUID = 0L;
/**
* Creates a new instance of a {@link Contact}.
*
* @param id the id of this contact
* @param name the name of this contact
* @since Envoy Common v0.1-beta
*/
public Contact(long id, String name) {
this.id = id;
this.name = name;
}
/**
* @return the ID of this {@link Contact}
* @since Envoy Common v0.2-alpha
*/
public long getId() { return id; }
/**
* @return the name of this {@link Contact}
* @since Envoy Common v0.2-alpha
*/
public String getName() { return name; }
/**
* @param newName the new name of this {@link Contact}
* @since Envoy Common v0.1-beta
*/
public void setName(String newName) { name = newName; }
/**
* {@inheritDoc}
*/
@Override
public String toString() { return String.format("Contact[id=%d,name=%s]", id, name); }
}