DATACMNS-1141 - Add missing NonNullApi and Nullable annotations.

This commit is contained in:
Christoph Strobl
2017-08-22 13:31:16 +02:00
committed by Mark Paluch
parent 1e134cbd33
commit 0669632a61
20 changed files with 132 additions and 67 deletions

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2008-2011 the original author or authors.
* Copyright 2008-2017 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -15,25 +15,29 @@
*/
package org.springframework.data.domain;
import org.springframework.lang.Nullable;
/**
* Simple interface for entities.
*
* @param <ID> the type of the identifier
* @author Oliver Gierke
* @author Christoph Strobl
*/
public interface Persistable<ID> {
/**
* Returns the id of the entity.
*
* @return the id
* @return the id. Can be {@literal null}.
*/
@Nullable
ID getId();
/**
* Returns if the {@code Persistable} is new or was persisted already.
*
* @return if the object is new
* @return if {@literal true} the object is new.
*/
boolean isNew();
}