#653 - Polishing.

Expose nullability in Identifiable, ResourceSupport and Links via Optional.
This commit is contained in:
Oliver Gierke
2017-10-16 17:50:34 +02:00
parent 4c7227e274
commit d9c53b5eeb
9 changed files with 63 additions and 42 deletions

View File

@@ -16,6 +16,7 @@
package org.springframework.hateoas;
import java.io.Serializable;
import java.util.Optional;
/**
* Interface to mark objects that are identifiable by an ID of any type.
@@ -27,7 +28,7 @@ public interface Identifiable<ID extends Serializable> {
/**
* Returns the id identifying the object.
*
* @return the identifier or {@literal null} if not available.
* @return the identifier or {@link Optional#empty()} if not available.
*/
ID getId();
Optional<ID> getId();
}