All Downloads are FREE. Search and download functionalities are using the official Maven repository.

tech.simter.data.Id Maven / Gradle / Ivy

There is a newer version: 1.1.0
Show newest version
package tech.simter.data;

/**
 * A ID holder.
 *
 * @author RJ
 */
public class Id {
  protected T id;

  Id(T id) {
    this.id = id;
  }

  /**
   * Get the identity
   *
   * @return the identity
   */
  public T getId() {
    return id;
  }

  /**
   * Create a Id instance.
   *
   * @param  the identity type
   * @param id   the identity value
   * @return the instance
   */
  public static  Id with(TT id) {
    return new Id<>(id);
  }
}