From: Roland Häder Date: Sat, 5 Aug 2017 14:57:09 +0000 (+0200) Subject: Continued a bit: X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=11682e572578d5d748c3c9ce190e9f3d8a93d7de;p=jcontacts-core.git Continued a bit: - added events being fired when a contact instance has been created - updated jar(s) Signed-off-by: Roland Häder --- diff --git a/lib/jphone-core.jar b/lib/jphone-core.jar index c26881a..e02fe64 100644 Binary files a/lib/jphone-core.jar and b/lib/jphone-core.jar differ diff --git a/src/org/mxchange/jcontacts/events/contact/created/CreatedContactEvent.java b/src/org/mxchange/jcontacts/events/contact/created/CreatedContactEvent.java new file mode 100644 index 0000000..29d69e1 --- /dev/null +++ b/src/org/mxchange/jcontacts/events/contact/created/CreatedContactEvent.java @@ -0,0 +1,54 @@ +/* + * Copyright (C) 2017 Roland Häder + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +package org.mxchange.jcontacts.events.contact.created; + +import org.mxchange.jcontacts.contact.Contact; + +/** + * An interface for observable events being fired when a contact instance has + * been successfully created. This may happen when a contact profile was called. + *

+ * @author Roland Häder + */ +public class CreatedContactEvent implements ObservableCreatedContactEvent { + + /** + * Serial number + */ + private static final long serialVersionUID = 24_138_056_876_716_451L; + + /** + * Contact instance being created + */ + private final Contact createdContact; + + /** + * Constructor with contact instance + *

+ * @param createdContact Contact instance being created by helper + */ + public CreatedContactEvent (final Contact createdContact) { + // Set contact instance + this.createdContact = createdContact; + } + + @Override + public Contact getCreatedContact () { + return this.createdContact; + } + +} diff --git a/src/org/mxchange/jcontacts/events/contact/created/ObservableCreatedContactEvent.java b/src/org/mxchange/jcontacts/events/contact/created/ObservableCreatedContactEvent.java new file mode 100644 index 0000000..c386d68 --- /dev/null +++ b/src/org/mxchange/jcontacts/events/contact/created/ObservableCreatedContactEvent.java @@ -0,0 +1,37 @@ +/* + * Copyright (C) 2017 Roland Haeder + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +package org.mxchange.jcontacts.events.contact.created; + +import java.io.Serializable; +import org.mxchange.jcontacts.contact.Contact; + +/** + * An interface for observable events being fired when a contact instance has + * been successfully created. This may happen when a contact profile was called. + *

+ * @author Roland Haeder + */ +public interface ObservableCreatedContactEvent extends Serializable { + + /** + * Getter for created contact instance + *

+ * @return Created contact instance + */ + Contact getCreatedContact (); + +}