|
@ -1,12 +1,25 @@ |
|
|
package hs.fulda.de.ci.exam.project; |
|
|
package hs.fulda.de.ci.exam.project; |
|
|
|
|
|
|
|
|
public class SmsNotification extends Notification { |
|
|
public class SmsNotification extends Notification { |
|
|
|
|
|
String to; |
|
|
|
|
|
String content; |
|
|
public SmsNotification(String to, String content) { |
|
|
public SmsNotification(String to, String content) { |
|
|
super(); |
|
|
super(); |
|
|
|
|
|
this.to = to; |
|
|
|
|
|
this.content = content; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
@Override |
|
|
@Override |
|
|
public boolean sendNotification() { |
|
|
public boolean sendNotification() { |
|
|
|
|
|
if (isValidEmail(to)) { |
|
|
|
|
|
System.out.println("SMS is sent to " + to); |
|
|
|
|
|
return true; |
|
|
|
|
|
} |
|
|
|
|
|
System.out.println("Invalid Number"); |
|
|
|
|
|
return false; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private boolean isValidEmail(String to) { |
|
|
return true; |
|
|
return true; |
|
|
} |
|
|
} |
|
|
} |
|
|
} |