black.door.hate.LinkOrResource Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of hate Show documentation
Show all versions of hate Show documentation
HATEOAS with HAL for Java
package black.door.hate;
import java.util.Optional;
/**
* Created by nfischer on 1/31/2016.
*/
public interface LinkOrResource {
HalLink asLink();
default Optional asResource(){
if(this instanceof HalResource){
return Optional.of((HalResource) this);
}else
return Optional.empty();
}
}