Add files via upload
This commit is contained in:
committed by
GitHub
parent
f76d6bd668
commit
565f69ecf3
@@ -1,7 +1,5 @@
|
|||||||
package com.baeldung.markerinterface;
|
package com.baeldung.markerinterface;
|
||||||
|
|
||||||
public interface DeletableShape {
|
public interface DeletableShape extends Shape {
|
||||||
double getArea();
|
|
||||||
|
|
||||||
double getCircumference();
|
}
|
||||||
}
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
package com.baeldung.markerinterface;
|
package com.baeldung.markerinterface;
|
||||||
|
|
||||||
public class Rectangle implements Deletable {
|
public class Rectangle implements DeletableShape {
|
||||||
|
|
||||||
private double width;
|
private double width;
|
||||||
private double height;
|
private double height;
|
||||||
|
|||||||
@@ -0,0 +1,6 @@
|
|||||||
|
package com.baeldung.markerinterface;
|
||||||
|
|
||||||
|
public interface Shape {
|
||||||
|
double getArea();
|
||||||
|
double getCircumference();
|
||||||
|
}
|
||||||
@@ -3,7 +3,7 @@ package com.baeldung.markerinterface;
|
|||||||
public class ShapeDao {
|
public class ShapeDao {
|
||||||
|
|
||||||
public boolean delete(Object object) {
|
public boolean delete(Object object) {
|
||||||
if (!(object instanceof Deletable)) {
|
if (!(object instanceof DeletableShape)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
// Calling the code that deletes the entity from the database
|
// Calling the code that deletes the entity from the database
|
||||||
|
|||||||
Reference in New Issue
Block a user