Android Open Source - notes Abstract Note

From Project

Back to project page notes.


The source code is released under:

DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE Version 2, December 2004 Copyright (C) 2004 Sam Hocevar <> Everyone is permitted to copy and distribute verbatim or...

If you think the Android project notes listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

package com.iliakplv.notes.notes;
/*ww  w.  j  a v  a2  s  .c o m*/
import com.iliakplv.notes.utils.StringUtils;
import org.joda.time.DateTime;


public abstract class AbstractNote {

  private Serializable id = NotesUtils.DEFAULT_ID;

  private String title;
  private String body;
  private DateTime createTime;
  private DateTime changeTime;

  public AbstractNote(String title, String body) {
    createTime = new DateTime();
    changeTime = new DateTime();

  // Text

  public String getTitle() {
    return title;

  public void setTitle(String title) {
    this.title = StringUtils.getNotNull(title);

  public String getBody() {
    return body;

  public void setBody(String body) {
    this.body = StringUtils.getNotNull(body);

  // Timestamps

  public DateTime getCreateTime() {
    return createTime;

  public void setCreateTime(DateTime time) {
    if (time == null) {
      throw new NullPointerException("Note's create time can not be null");
    createTime = time;

  public DateTime getChangeTime() {
    return changeTime;

  public void setChangeTime(DateTime time) {
    if (time == null) {
      throw new NullPointerException("Note's change time can not be null");
    changeTime = time;

  public void updateChangeTime() {
    changeTime = new DateTime();

  public Serializable getId() {
    return id;

  public void setId(Serializable id) { = NotesUtils.getValidNoteId(id);

Java Source Code List