Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
  package com.robrua.orianna.type.stats;
  
  import java.util.HashMap;
  import java.util.Map;
  
  public class AggregatedStats implements Serializable {
      private static final long serialVersionUID = -3459235144300883382L;
             totalTurretsKilledtotalUnrealKills;
 
     public AggregatedStats(final Integer averageAssistsfinal Integer averageChampionsKilledfinal Integer averageCombatPlayerScore,
             final Integer averageNodeCapturefinal Integer averageNodeCaptureAssistfinal Integer averageNodeNeutralize,
             final Integer averageNodeNeutralizeAssistfinal Integer averageNumDeathsfinal Integer averageObjectivePlayerScore,
             final Integer averageTeamObjectivefinal Integer averageTotalPlayerScorefinal Integer botGamesPlayedfinal Integer killingSpree,
             final Integer maxAssistsfinal Integer maxChampionsKilledfinal Integer maxCombatPlayerScorefinal Integer maxLargestCriticalStrike,
             final Integer maxLargestKillingSpreefinal Integer maxNodeCapturefinal Integer maxNodeCaputreAssistfinal Integer maxNodeNeutralize,
             final Integer maxNodeNeutralizeAssistfinal Integer maxNumDeathsfinal Integer maxObjectivePlayerScorefinal Integer maxTeamObjective,
             final Integer maxTimePlayedfinal Integer maxTimeSpentLivingfinal Integer maxTotalPlayerScorefinal Integer mostChampionKillsPerSession,
             final Integer mostSpellsCastfinal Integer normalGamesPlayedfinal Integer rankedPremadeGamesPlayedfinal Integer rankedSoloGamesPlayed,
             final Integer totalAssistsfinal Integer totalChampionKillsfinal Integer totalDamageDealtfinal Integer totalDamageTaken,
             final Integer totalDeathsPerSessionfinal Integer totalDoubleKillsfinal Integer totalFirstBloodfinal Integer totalGoldEarned,
             final Integer totalHealfinal Integer totalMagicDamageDealtfinal Integer totalMinionKillsfinal Integer totalNeutralMinionsKilled,
             final Integer totalNodeCapturefinal Integer totalNodeNeutralizefinal Integer totalPentaKillsfinal Integer totalPhysicalDamageDealt,
             final Integer totalQuadraKillsfinal Integer totalSessionsLostfinal Integer totalSessionsWonfinal Integer totalTripleKills,
             final Integer totalTurretsKilledfinal Integer totalUnrealKills) {
         this. = averageAssists;
         this. = averageChampionsKilled;
         this. = averageCombatPlayerScore;
         this. = averageNodeCapture;
         this. = averageNodeCaptureAssist;
         this. = averageNodeNeutralize;
         this. = averageNodeNeutralizeAssist;
         this. = averageNumDeaths;
         this. = averageObjectivePlayerScore;
         this. = averageTeamObjective;
         this. = averageTotalPlayerScore;
         this. = botGamesPlayed;
         this. = killingSpree;
         this. = maxAssists;
         this. = maxChampionsKilled;
         this. = maxCombatPlayerScore;
         this. = maxLargestCriticalStrike;
         this. = maxLargestKillingSpree;
         this. = maxNodeCapture;
         this. = maxNodeCaputreAssist;
         this. = maxNodeNeutralize;
         this. = maxNodeNeutralizeAssist;
         this. = maxNumDeaths;
         this. = maxObjectivePlayerScore;
         this. = maxTeamObjective;
         this. = maxTimePlayed;
         this. = maxTimeSpentLiving;
         this. = maxTotalPlayerScore;
         this. = mostChampionKillsPerSession;
         this. = mostSpellsCast;
         this. = normalGamesPlayed;
         this. = rankedPremadeGamesPlayed;
         this. = rankedSoloGamesPlayed;
         this. = totalAssists;
         this. = totalChampionKills;
         this. = totalDamageDealt;
         this. = totalDamageTaken;
         this. = totalDeathsPerSession;
         this. = totalDoubleKills;
         this. = totalFirstBlood;
         this. = totalGoldEarned;
         this. = totalHeal;
         this. = totalMagicDamageDealt;
         this. = totalMinionKills;
         this. = totalNeutralMinionsKilled;
         this. = totalNodeCapture;
         this. = totalNodeNeutralize;
         this. = totalPentaKills;
         this. = totalPhysicalDamageDealt;
         this. = totalQuadraKills;
         this. = totalSessionsLost;
         this. = totalSessionsWon;
         this. = totalTripleKills;
         this. = totalTurretsKilled;
         this. = totalUnrealKills;
     }
 
     @Override
     public boolean equals(final Object obj) {
         if(this == obj) {
             return true;
         }
         if(obj == null) {
             return false;
         }
        if(!(obj instanceof AggregatedStats)) {
            return false;
        }
        final AggregatedStats other = (AggregatedStats)obj;
        if( == null) {
            if(other.averageAssists != null) {
                return false;
            }
        }
        else if(!.equals(other.averageAssists)) {
            return false;
        }
        if( == null) {
            if(other.averageChampionsKilled != null) {
                return false;
            }
        }
        else if(!.equals(other.averageChampionsKilled)) {
            return false;
        }
        if( == null) {
            if(other.averageCombatPlayerScore != null) {
                return false;
            }
        }
        else if(!.equals(other.averageCombatPlayerScore)) {
            return false;
        }
        if( == null) {
            if(other.averageNodeCapture != null) {
                return false;
            }
        }
        else if(!.equals(other.averageNodeCapture)) {
            return false;
        }
        if( == null) {
            if(other.averageNodeCaptureAssist != null) {
                return false;
            }
        }
        else if(!.equals(other.averageNodeCaptureAssist)) {
            return false;
        }
        if( == null) {
            if(other.averageNodeNeutralize != null) {
                return false;
            }
        }
        else if(!.equals(other.averageNodeNeutralize)) {
            return false;
        }
        if( == null) {
            if(other.averageNodeNeutralizeAssist != null) {
                return false;
            }
        }
        else if(!.equals(other.averageNodeNeutralizeAssist)) {
            return false;
        }
        if( == null) {
            if(other.averageNumDeaths != null) {
                return false;
            }
        }
        else if(!.equals(other.averageNumDeaths)) {
            return false;
        }
        if( == null) {
            if(other.averageObjectivePlayerScore != null) {
                return false;
            }
        }
        else if(!.equals(other.averageObjectivePlayerScore)) {
            return false;
        }
        if( == null) {
            if(other.averageTeamObjective != null) {
                return false;
            }
        }
        else if(!.equals(other.averageTeamObjective)) {
            return false;
        }
        if( == null) {
            if(other.averageTotalPlayerScore != null) {
                return false;
            }
        }
        else if(!.equals(other.averageTotalPlayerScore)) {
            return false;
        }
        if( == null) {
            if(other.botGamesPlayed != null) {
                return false;
            }
        }
        else if(!.equals(other.botGamesPlayed)) {
            return false;
        }
        if( == null) {
            if(other.killingSpree != null) {
                return false;
            }
        }
        else if(!.equals(other.killingSpree)) {
            return false;
        }
        if( == null) {
            if(other.maxAssists != null) {
                return false;
            }
        }
        else if(!.equals(other.maxAssists)) {
            return false;
        }
        if( == null) {
            if(other.maxChampionsKilled != null) {
                return false;
            }
        }
        else if(!.equals(other.maxChampionsKilled)) {
            return false;
        }
        if( == null) {
            if(other.maxCombatPlayerScore != null) {
                return false;
            }
        }
        else if(!.equals(other.maxCombatPlayerScore)) {
            return false;
        }
        if( == null) {
            if(other.maxLargestCriticalStrike != null) {
                return false;
            }
        }
        else if(!.equals(other.maxLargestCriticalStrike)) {
            return false;
        }
        if( == null) {
            if(other.maxLargestKillingSpree != null) {
                return false;
            }
        }
        else if(!.equals(other.maxLargestKillingSpree)) {
            return false;
        }
        if( == null) {
            if(other.maxNodeCapture != null) {
                return false;
            }
        }
        else if(!.equals(other.maxNodeCapture)) {
            return false;
        }
        if( == null) {
            if(other.maxNodeCaputreAssist != null) {
                return false;
            }
        }
        else if(!.equals(other.maxNodeCaputreAssist)) {
            return false;
        }
        if( == null) {
            if(other.maxNodeNeutralize != null) {
                return false;
            }
        }
        else if(!.equals(other.maxNodeNeutralize)) {
            return false;
        }
        if( == null) {
            if(other.maxNodeNeutralizeAssist != null) {
                return false;
            }
        }
        else if(!.equals(other.maxNodeNeutralizeAssist)) {
            return false;
        }
        if( == null) {
            if(other.maxNumDeaths != null) {
                return false;
            }
        }
        else if(!.equals(other.maxNumDeaths)) {
            return false;
        }
        if( == null) {
            if(other.maxObjectivePlayerScore != null) {
                return false;
            }
        }
        else if(!.equals(other.maxObjectivePlayerScore)) {
            return false;
        }
        if( == null) {
            if(other.maxTeamObjective != null) {
                return false;
            }
        }
        else if(!.equals(other.maxTeamObjective)) {
            return false;
        }
        if( == null) {
            if(other.maxTimePlayed != null) {
                return false;
            }
        }
        else if(!.equals(other.maxTimePlayed)) {
            return false;
        }
        if( == null) {
            if(other.maxTimeSpentLiving != null) {
                return false;
            }
        }
        else if(!.equals(other.maxTimeSpentLiving)) {
            return false;
        }
        if( == null) {
            if(other.maxTotalPlayerScore != null) {
                return false;
            }
        }
        else if(!.equals(other.maxTotalPlayerScore)) {
            return false;
        }
        if( == null) {
            if(other.mostChampionKillsPerSession != null) {
                return false;
            }
        }
        else if(!.equals(other.mostChampionKillsPerSession)) {
            return false;
        }
        if( == null) {
            if(other.mostSpellsCast != null) {
                return false;
            }
        }
        else if(!.equals(other.mostSpellsCast)) {
            return false;
        }
        if( == null) {
            if(other.normalGamesPlayed != null) {
                return false;
            }
        }
        else if(!.equals(other.normalGamesPlayed)) {
            return false;
        }
        if( == null) {
            if(other.rankedPremadeGamesPlayed != null) {
                return false;
            }
        }
        else if(!.equals(other.rankedPremadeGamesPlayed)) {
            return false;
        }
        if( == null) {
            if(other.rankedSoloGamesPlayed != null) {
                return false;
            }
        }
        else if(!.equals(other.rankedSoloGamesPlayed)) {
            return false;
        }
        if( == null) {
            if(other.totalAssists != null) {
                return false;
            }
        }
        else if(!.equals(other.totalAssists)) {
            return false;
        }
        if( == null) {
            if(other.totalChampionKills != null) {
                return false;
            }
        }
        else if(!.equals(other.totalChampionKills)) {
            return false;
        }
        if( == null) {
            if(other.totalDamageDealt != null) {
                return false;
            }
        }
        else if(!.equals(other.totalDamageDealt)) {
            return false;
        }
        if( == null) {
            if(other.totalDamageTaken != null) {
                return false;
            }
        }
        else if(!.equals(other.totalDamageTaken)) {
            return false;
        }
        if( == null) {
            if(other.totalDeathsPerSession != null) {
                return false;
            }
        }
        else if(!.equals(other.totalDeathsPerSession)) {
            return false;
        }
        if( == null) {
            if(other.totalDoubleKills != null) {
                return false;
            }
        }
        else if(!.equals(other.totalDoubleKills)) {
            return false;
        }
        if( == null) {
            if(other.totalFirstBlood != null) {
                return false;
            }
        }
        else if(!.equals(other.totalFirstBlood)) {
            return false;
        }
        if( == null) {
            if(other.totalGoldEarned != null) {
                return false;
            }
        }
        else if(!.equals(other.totalGoldEarned)) {
            return false;
        }
        if( == null) {
            if(other.totalHeal != null) {
                return false;
            }
        }
        else if(!.equals(other.totalHeal)) {
            return false;
        }
        if( == null) {
            if(other.totalMagicDamageDealt != null) {
                return false;
            }
        }
        else if(!.equals(other.totalMagicDamageDealt)) {
            return false;
        }
        if( == null) {
            if(other.totalMinionKills != null) {
                return false;
            }
        }
        else if(!.equals(other.totalMinionKills)) {
            return false;
        }
        if( == null) {
            if(other.totalNeutralMinionsKilled != null) {
                return false;
            }
        }
        else if(!.equals(other.totalNeutralMinionsKilled)) {
            return false;
        }
        if( == null) {
            if(other.totalNodeCapture != null) {
                return false;
            }
        }
        else if(!.equals(other.totalNodeCapture)) {
            return false;
        }
        if( == null) {
            if(other.totalNodeNeutralize != null) {
                return false;
            }
        }
        else if(!.equals(other.totalNodeNeutralize)) {
            return false;
        }
        if( == null) {
            if(other.totalPentaKills != null) {
                return false;
            }
        }
        else if(!.equals(other.totalPentaKills)) {
            return false;
        }
        if( == null) {
            if(other.totalPhysicalDamageDealt != null) {
                return false;
            }
        }
        else if(!.equals(other.totalPhysicalDamageDealt)) {
            return false;
        }
        if( == null) {
            if(other.totalQuadraKills != null) {
                return false;
            }
        }
        else if(!.equals(other.totalQuadraKills)) {
            return false;
        }
        if( == null) {
            if(other.totalSessionsLost != null) {
                return false;
            }
        }
        else if(!.equals(other.totalSessionsLost)) {
            return false;
        }
        if( == null) {
            if(other.totalSessionsWon != null) {
                return false;
            }
        }
        else if(!.equals(other.totalSessionsWon)) {
            return false;
        }
        if( == null) {
            if(other.totalTripleKills != null) {
                return false;
            }
        }
        else if(!.equals(other.totalTripleKills)) {
            return false;
        }
        if( == null) {
            if(other.totalTurretsKilled != null) {
                return false;
            }
        }
        else if(!.equals(other.totalTurretsKilled)) {
            return false;
        }
        if( == null) {
            if(other.totalUnrealKills != null) {
                return false;
            }
        }
        else if(!.equals(other.totalUnrealKills)) {
            return false;
        }
        return true;
    }
    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ( == null ? 0 : .hashCode());
        result = prime * result + ( == null ? 0 : .hashCode());
        result = prime * result + ( == null ? 0 : .hashCode());
        result = prime * result + ( == null ? 0 : .hashCode());
        result = prime * result + ( == null ? 0 : .hashCode());
        result = prime * result + ( == null ? 0 : .hashCode());
        result = prime * result + ( == null ? 0 : .hashCode());
        result = prime * result + ( == null ? 0 : .hashCode());
        result = prime * result + ( == null ? 0 : .hashCode());
        result = prime * result + ( == null ? 0 : .hashCode());
        result = prime * result + ( == null ? 0 : .hashCode());
        result = prime * result + ( == null ? 0 : .hashCode());
        result = prime * result + ( == null ? 0 : .hashCode());
        result = prime * result + ( == null ? 0 : .hashCode());
        result = prime * result + ( == null ? 0 : .hashCode());
        result = prime * result + ( == null ? 0 : .hashCode());
        result = prime * result + ( == null ? 0 : .hashCode());
        result = prime * result + ( == null ? 0 : .hashCode());
        result = prime * result + ( == null ? 0 : .hashCode());
        result = prime * result + ( == null ? 0 : .hashCode());
        result = prime * result + ( == null ? 0 : .hashCode());
        result = prime * result + ( == null ? 0 : .hashCode());
        result = prime * result + ( == null ? 0 : .hashCode());
        result = prime * result + ( == null ? 0 : .hashCode());
        result = prime * result + ( == null ? 0 : .hashCode());
        result = prime * result + ( == null ? 0 : .hashCode());
        result = prime * result + ( == null ? 0 : .hashCode());
        result = prime * result + ( == null ? 0 : .hashCode());
        result = prime * result + ( == null ? 0 : .hashCode());
        result = prime * result + ( == null ? 0 : .hashCode());
        result = prime * result + ( == null ? 0 : .hashCode());
        result = prime * result + ( == null ? 0 : .hashCode());
        result = prime * result + ( == null ? 0 : .hashCode());
        result = prime * result + ( == null ? 0 : .hashCode());
        result = prime * result + ( == null ? 0 : .hashCode());
        result = prime * result + ( == null ? 0 : .hashCode());
        result = prime * result + ( == null ? 0 : .hashCode());
        result = prime * result + ( == null ? 0 : .hashCode());
        result = prime * result + ( == null ? 0 : .hashCode());
        result = prime * result + ( == null ? 0 : .hashCode());
        result = prime * result + ( == null ? 0 : .hashCode());
        result = prime * result + ( == null ? 0 : .hashCode());
        result = prime * result + ( == null ? 0 : .hashCode());
        result = prime * result + ( == null ? 0 : .hashCode());
        result = prime * result + ( == null ? 0 : .hashCode());
        result = prime * result + ( == null ? 0 : .hashCode());
        result = prime * result + ( == null ? 0 : .hashCode());
        result = prime * result + ( == null ? 0 : .hashCode());
        result = prime * result + ( == null ? 0 : .hashCode());
        result = prime * result + ( == null ? 0 : .hashCode());
        result = prime * result + ( == null ? 0 : .hashCode());
        result = prime * result + ( == null ? 0 : .hashCode());
        result = prime * result + ( == null ? 0 : .hashCode());
        result = prime * result + ( == null ? 0 : .hashCode());
        result = prime * result + ( == null ? 0 : .hashCode());
        return result;
    }

    
Gets only the stats which weren't null

Returns:
the non-null stats
    public Map<StringIntegernonNullStats() {
        final Map<StringIntegernonNull = new HashMap<StringInteger>();
        if( != null) {
            nonNull.put("averageAssists");
        }
        if( != null) {
            nonNull.put("averageChampionsKilled");
        }
        if( != null) {
            nonNull.put("averageCombatPlayerScore");
        }
        if( != null) {
            nonNull.put("averageNodeCapture");
        }
        if( != null) {
            nonNull.put("averageNodeCaptureAssist");
        }
        if( != null) {
            nonNull.put("averageNodeNeutralize");
        }
        if( != null) {
            nonNull.put("averageNodeNeutralizeAssist");
        }
        if( != null) {
            nonNull.put("averageNumDeaths");
        }
        if( != null) {
            nonNull.put("averageObjectivePlayerScore");
        }
        if( != null) {
            nonNull.put("averageTeamObjective");
        }
        if( != null) {
            nonNull.put("averageTotalPlayerScore");
        }
        if( != null) {
            nonNull.put("botGamesPlayed");
        }
        if( != null) {
            nonNull.put("killingSpree");
        }
        if( != null) {
            nonNull.put("maxAssists");
        }
        if( != null) {
            nonNull.put("maxChampionsKilled");
        }
        if( != null) {
            nonNull.put("maxCombatPlayerScore");
        }
        if( != null) {
            nonNull.put("maxLargestCriticalStrike");
        }
        if( != null) {
            nonNull.put("maxLargestKillingSpree");
        }
        if( != null) {
            nonNull.put("maxNodeCapture");
        }
        if( != null) {
            nonNull.put("maxNodeCaputreAssist");
        }
        if( != null) {
            nonNull.put("maxNodeNeutralize");
        }
        if( != null) {
            nonNull.put("maxNodeNeutralizeAssist");
        }
        if( != null) {
            nonNull.put("maxNumDeaths");
        }
        if( != null) {
            nonNull.put("maxObjectivePlayerScore");
        }
        if( != null) {
            nonNull.put("maxTeamObjective");
        }
        if( != null) {
            nonNull.put("maxTimePlayed");
        }
        if( != null) {
            nonNull.put("maxTimeSpentLiving");
        }
        if( != null) {
            nonNull.put("maxTotalPlayerScore");
        }
        if( != null) {
            nonNull.put("mostChampionKillsPerSession");
        }
        if( != null) {
            nonNull.put("mostSpellsCast");
        }
        if( != null) {
            nonNull.put("normalGamesPlayed");
        }
        if( != null) {
            nonNull.put("rankedPremadeGamesPlayed");
        }
        if( != null) {
            nonNull.put("rankedSoloGamesPlayed");
        }
        if( != null) {
            nonNull.put("totalAssists");
        }
        if( != null) {
            nonNull.put("totalChampionKills");
        }
        if( != null) {
            nonNull.put("totalDamageDealt");
        }
        if( != null) {
            nonNull.put("totalDamageTaken");
        }
        if( != null) {
            nonNull.put("totalDeathsPerSession");
        }
        if( != null) {
            nonNull.put("totalDoubleKills");
        }
        if( != null) {
            nonNull.put("totalFirstBlood");
        }
        if( != null) {
            nonNull.put("totalGoldEarned");
        }
        if( != null) {
            nonNull.put("totalHeal");
        }
        if( != null) {
            nonNull.put("totalMagicDamageDealt");
        }
        if( != null) {
            nonNull.put("totalMinionKills");
        }
        if( != null) {
            nonNull.put("totalNeutralMinionsKilled");
        }
        if( != null) {
            nonNull.put("totalNodeCapture");
        }
        if( != null) {
            nonNull.put("totalNodeNeutralize");
        }
        if( != null) {
            nonNull.put("totalPentaKills");
        }
        if( != null) {
            nonNull.put("totalPhysicalDamageDealt");
        }
        if( != null) {
            nonNull.put("totalQuadraKills");
        }
        if( != null) {
            nonNull.put("totalSessionsLost");
        }
        if( != null) {
            nonNull.put("totalSessionsWon");
        }
        if( != null) {
            nonNull.put("totalTripleKills");
        }
        if( != null) {
            nonNull.put("totalTurretsKilled");
        }
        if( != null) {
            nonNull.put("totalUnrealKills");
        }
        return Collections.unmodifiableMap(nonNull);
    }
    @Override
    public String toString() {
        return "AggregatedStats";
    }
New to GrepCode? Check out our FAQ X