Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
  package com.robrua.orianna.type.staticdata;
  
  import java.util.HashMap;
  import java.util.List;
  import java.util.Map;
  
 public class MasteryTree implements Serializable {
     private static final long serialVersionUID = -1878212419731346677L;
     public final List<MasteryTreeListdefenseoffenseutility;
     private final Map<MasteryMasteryTypetypes;
 
     public MasteryTree(final List<MasteryTreeListdefensefinal List<MasteryTreeListoffensefinal List<MasteryTreeListutility) {
         this. = defense;
         this. = offense;
         this. = utility;
          = new HashMap<MasteryMasteryType>();
 
         offense.forEach((list) -> list.masteryTreeItems.forEach((item) -> {
             if(item != null) {
                 .put(item.mastery.);
             }
         }));
         defense.forEach((list) -> list.masteryTreeItems.forEach((item) -> {
             if(item != null) {
                 .put(item.mastery.);
             }
         }));
         utility.forEach((list) -> list.masteryTreeItems.forEach((item) -> {
             if(item != null) {
                 .put(item.mastery.);
             }
         }));
     }

    
Gets defensive masteries

Returns:
defensive masteries
 
     public List<MasterydefensiveMasteries() {
         return Collections.unmodifiableList(.entrySet().stream().filter((entry) -> entry.getValue() == .).map((entry) -> entry.getKey())
                 .collect(Collectors.toList()));
     }
 
     @Override
     public boolean equals(final Object obj) {
         if(this == obj) {
             return true;
         }
         if(obj == null) {
             return false;
         }
         if(!(obj instanceof MasteryTree)) {
             return false;
         }
         final MasteryTree other = (MasteryTree)obj;
         if( == null) {
             if(other.defense != null) {
                 return false;
             }
         }
         else if(!.equals(other.defense)) {
             return false;
         }
         if( == null) {
             if(other.offense != null) {
                 return false;
             }
         }
         else if(!.equals(other.offense)) {
             return false;
         }
         if( == null) {
             if(other.utility != null) {
                 return false;
             }
         }
         else if(!.equals(other.utility)) {
             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());
         return result;
     }

    
Gets offensive masteries

Returns:
offensive masteries
    public List<MasteryoffensiveMasteries() {
        return Collections.unmodifiableList(.entrySet().stream().filter((entry) -> entry.getValue() == .).map((entry) -> entry.getKey())
                .collect(Collectors.toList()));
    }
    @Override
    public String toString() {
        return "MasteryTree";
    }

    
Determines of what type a mastery is (offense, defense, utility)

Parameters:
mastery the mastery to test
Returns:
the mastery's type
    public MasteryType typeOf(final Mastery mastery) {
        return .get(mastery);
    }

    
Gets utility masteries

Returns:
utility masteries
    public List<MasteryutilityMasteries() {
        return Collections.unmodifiableList(.entrySet().stream().filter((entry) -> entry.getValue() == .).map((entry) -> entry.getKey())
                .collect(Collectors.toList()));
    }
New to GrepCode? Check out our FAQ X