Skip to content
Snippets Groups Projects
Commit 8455fd5a authored by Andreas Wundsam's avatar Andreas Wundsam
Browse files

openflowj/StaitisticsMessageBase: wildcard/fix type parameter of sub-statistics

Having "? extends OFStatistics" instead of "Statistics" allows for
typesafe assignment of sub-statistics
parent 131f1e47
No related branches found
No related tags found
No related merge requests found
...@@ -41,7 +41,7 @@ public abstract class OFStatisticsMessageBase extends OFMessage implements ...@@ -41,7 +41,7 @@ public abstract class OFStatisticsMessageBase extends OFMessage implements
// TODO: this should be List<? extends OFStatistics>, to // TODO: this should be List<? extends OFStatistics>, to
// allow for type safe assignments of lists of specific message // allow for type safe assignments of lists of specific message
protected List<OFStatistics> statistics; protected List<? extends OFStatistics> statistics;
/** /**
* @return the statisticType * @return the statisticType
...@@ -74,7 +74,7 @@ public abstract class OFStatisticsMessageBase extends OFMessage implements ...@@ -74,7 +74,7 @@ public abstract class OFStatisticsMessageBase extends OFMessage implements
/** /**
* @return the statistics * @return the statistics
*/ */
public List<OFStatistics> getStatistics() { public List<? extends OFStatistics> getStatistics() {
return statistics; return statistics;
} }
...@@ -98,7 +98,7 @@ public abstract class OFStatisticsMessageBase extends OFMessage implements ...@@ -98,7 +98,7 @@ public abstract class OFStatisticsMessageBase extends OFMessage implements
/** /**
* @param statistics the statistics to set * @param statistics the statistics to set
*/ */
public void setStatistics(List<OFStatistics> statistics) { public void setStatistics(List<? extends OFStatistics> statistics) {
this.statistics = statistics; this.statistics = statistics;
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment