Skip to content

Commit ee006d5

Browse files
committed
Add generic type parameter in the interface IComplexPropertyChangedDelegate
1 parent da998b5 commit ee006d5

3 files changed

Lines changed: 13 additions & 13 deletions

File tree

src/main/java/microsoft/exchange/webservices/data/property/complex/ComplexPropertyCollection.java

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@
4848
public abstract class ComplexPropertyCollection
4949
<TComplexProperty extends ComplexProperty>
5050
extends ComplexProperty implements ICustomXmlUpdateSerializer,
51-
Iterable<TComplexProperty>, IComplexPropertyChangedDelegate {
51+
Iterable<TComplexProperty>, IComplexPropertyChangedDelegate<TComplexProperty> {
5252

5353
/**
5454
* The item.
@@ -101,12 +101,11 @@ protected ComplexPropertyCollection() {
101101
/**
102102
* Item changed.
103103
*
104-
* @param complexProperty The complex property.
104+
* @param property The complex property.
105105
*/
106-
protected void itemChanged(final ComplexProperty complexProperty) {
107-
final TComplexProperty property = (TComplexProperty) complexProperty;
106+
protected void itemChanged(final TComplexProperty property) {
108107
EwsUtilities.ewsAssert(
109-
complexProperty != null, "ComplexPropertyCollection.ItemChanged",
108+
property != null, "ComplexPropertyCollection.ItemChanged",
110109
"The complexProperty argument must be not null"
111110
);
112111

@@ -332,7 +331,7 @@ private void internalAdd(TComplexProperty complexProperty,
332331
* @param complexProperty accepts ComplexProperty
333332
*/
334333
@Override
335-
public void complexPropertyChanged(ComplexProperty complexProperty) {
334+
public void complexPropertyChanged(final TComplexProperty complexProperty) {
336335
this.itemChanged(complexProperty);
337336
}
338337

src/main/java/microsoft/exchange/webservices/data/property/complex/DictionaryProperty.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@
5050
@EditorBrowsable(state = EditorBrowsableState.Never)
5151
public abstract class DictionaryProperty
5252
<TKey, TEntry extends DictionaryEntryProperty<TKey>>
53-
extends ComplexProperty implements ICustomXmlUpdateSerializer, IComplexPropertyChangedDelegate {
53+
extends ComplexProperty implements ICustomXmlUpdateSerializer, IComplexPropertyChangedDelegate<TEntry> {
5454

5555
/**
5656
* The entries.
@@ -77,8 +77,8 @@ public abstract class DictionaryProperty
7777
*
7878
* @param complexProperty the complex property
7979
*/
80-
private void entryChanged(ComplexProperty complexProperty) {
81-
TKey key = ((TEntry) complexProperty).getKey();
80+
private void entryChanged(final TEntry complexProperty) {
81+
TKey key = complexProperty.getKey();
8282

8383
if (!this.addedEntries.contains(key) && !this.modifiedEntries.contains(key)) {
8484
this.modifiedEntries.add(key);
@@ -188,8 +188,8 @@ protected void internalAdd(TEntry entry) {
188188
* @param complexProperty accepts ComplexProperty
189189
*/
190190
@Override
191-
public void complexPropertyChanged(ComplexProperty complexProperty) {
192-
this.entryChanged(complexProperty);
191+
public void complexPropertyChanged(final TEntry complexProperty) {
192+
entryChanged(complexProperty);
193193
}
194194

195195
/**

src/main/java/microsoft/exchange/webservices/data/property/complex/IComplexPropertyChangedDelegate.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,13 @@
2626
/**
2727
* The Interface ComplexPropertyChangedDelegateInterface.
2828
*/
29-
public interface IComplexPropertyChangedDelegate {
29+
public interface IComplexPropertyChangedDelegate<TComplexProperty extends ComplexProperty> {
3030

3131
/**
3232
* Complex property changed.
3333
*
3434
* @param complexProperty the complex property
3535
*/
36-
void complexPropertyChanged(ComplexProperty complexProperty);
36+
void complexPropertyChanged(TComplexProperty complexProperty);
37+
3738
}

0 commit comments

Comments
 (0)