Last active
July 28, 2021 06:42
-
-
Save ajinzrathod/d0465d54a251e4aa1c96e95df42dc519 to your computer and use it in GitHub Desktop.
Sharing Annotation Example
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
interface Deletable { | |
} | |
class Entity implements Deletable { | |
// implementation details | |
} | |
class ShapeDao extends Entity { | |
// other dao methods | |
public boolean delete(Object object) { | |
if (!(object instanceof Deletable)) { | |
return false; | |
} | |
// delete implementation details | |
return true; | |
} | |
} | |
public class UsingMarkerInterface { | |
public static void main(String[] args) { | |
ShapeDao sd = new ShapeDao(); | |
System.out.println(sd.delete(sd)); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment