Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
  package com.robrua.orianna.type.core.staticdata;
  
  import java.util.List;
  
  
     private static final long serialVersionUID = -7519485867013847385L;
     private List<ImagealtImages;
     private List<Doublecooldown;
     private List<Integercostrange;
     private List<List<Double>> effect;
     private List<StringeffectBurn;
     private Image image;
     private LevelTip levelTip;
     private List<SpellVarsvars;

    

Parameters:
data the underlying dto
 
     public ChampionSpell(final com.robrua.orianna.type.dto.staticdata.ChampionSpell data) {
         super(datacom.robrua.orianna.type.dto.staticdata.ChampionSpell.class);
     }

    
Alternate images

Returns:
alternate images
 
     public List<ImagegetAlternateImages() {
         if( == null) {
              = new ArrayList<>();
             for(final com.robrua.orianna.type.dto.staticdata.Image img : .getAltimages()) {
                 .add(new Image(img));
             }
         }
 
         return Collections.unmodifiableList();
     }

    
Cooldown

Returns:
cooldown
 
     public List<DoublegetCooldown() {
         if( == null) {
              = new ArrayList<Double>();
             .addAll(.getCooldown());
         }
 
         return Collections.unmodifiableList();
     }

    
Cooldown burn

Returns:
cooldown burn
 
     public String getCooldownBurn() {
         return super.getString(.getCooldownBurn());
     }

    
Cost

Returns:
cost
 
     public List<IntegergetCost() {
         if( == null) {
              = new ArrayList<>();
             .addAll(.getCost());
         }
 
         return Collections.unmodifiableList();
     }

    
Cost burn

Returns:
cost burn
 
     public String getCostBurn() {
         return super.getString(.getCostBurn());
     }

    
Cost type

Returns:
cost type
 
     public String getCostType() {
         return super.getString(.getCostType());
     }

    
Description

Returns:
description
    public String getDescription() {
        return super.getString(.getDescription());
    }

    
Effect

Returns:
effect
    public List<List<Double>> getEffect() {
        if( == null) {
             = new ArrayList<>();
            if(.getEffect() != null) {
                for(final List<Doublee : .getEffect()) {
                    .add(e == null ? null : Collections.unmodifiableList(e));
                }
            }
        }
        return Collections.unmodifiableList();
    }

    
Effect burn

Returns:
effect burn
    public List<StringgetEffectBurn() {
        if( == null) {
             = new ArrayList<>();
            .addAll(.getEffectBurn());
        }
        return Collections.unmodifiableList();
    }

    
Image

Returns:
image
    public Image getImage() {
        if( == null) {
             = new Image(.getImage());
        }
        return ;
    }

    
Key

Returns:
key
    public String getKey() {
        return super.getString(.getKey());
    }

    
Level tip

Returns:
level tip
    public LevelTip getLevelTip() {
        if( == null) {
             = new LevelTip(.getLeveltip());
        }
        return ;
    }

    
Max rank

Returns:
max rank
    public int getMaxRank() {
        return super.getInteger(.getMaxrank());
    }

    
Name

Returns:
name
    public String getName() {
        return super.getString(.getName());
    }

    
Range

Returns:
range or null if this spell targets self
    public List<IntegergetRange() {
        if( == null) {
            if(.getRange() == null) {
                return null;
            }
             = new ArrayList<>();
            .addAll(.getRange());
        }
        return Collections.unmodifiableList();
    }

    
Range burn

Returns:
range burn
    public String getRangeBurn() {
        return super.getString(.getRangeBurn());
    }

    
Resource

Returns:
resource
    public String getResource() {
        return super.getString(.getResource());
    }

    
Sanitized description

Returns:
sanitized description
    public String getSanitizedDescription() {
        return super.getString(.getSanitizedDescription());
    }

    
Sanitized tooltip

Returns:
sanitized tooltip
    public String getSanitizedTooltip() {
        return super.getString(.getSanitizedTooltip());
    }

    
Replaces the variables in the sanitized tooltip with numerical values

Parameters:
champLevel the champion level to get the specific sanitized tooltip for
spellLevel the spell rank to get the specific sanitized tooltip for
Returns:
the sanitized tooltip with numerical values
    public String getSanitizedTooltip(final int champLevelfinal int spellLevel) {
        return replaceVariables(getSanitizedTooltip(), champLevelspellLevel);
    }

    
Spell vars

Returns:
spell vars
    public List<SpellVarsgetSpellVars() {
        if( == null) {
             = new ArrayList<>();
            if(.getVars() != null) {
                for(final com.robrua.orianna.type.dto.staticdata.SpellVars v : .getVars()) {
                    .add(new SpellVars(v));
                }
            }
        }
        return Collections.unmodifiableList();
    }

    
Tooltip

Returns:
tooltip
    public String getTooltip() {
        return super.getString(.getTooltip());
    }

    
Replaces the variables in the tooltip with numerical values

Parameters:
champLevel the champion level to get the specific tooltip for
spellLevel the spell rank to get the specific tooltip for
Returns:
the tooltip with numerical values
    public String getTooltip(final int champLevelfinal int spellLevel) {
        return replaceVariables(getTooltip(), champLevelspellLevel);
    }

    
Replaces spell variables in description with values

Parameters:
text the text to replace in
champLevel the champion level to get values for
spellLevel the spell level to get values for
Returns:
the fixed text
    private String replaceVariables(String textfinal int champLevelfinal int spellLevel) {
        final int maxRank = getMaxRank();
        if(spellLevel < 1 || spellLevel > maxRank) {
            throw new IllegalArgumentException("Not a valid level for this spell!");
        }
        if(champLevel < 1 || champLevel > 18) {
            throw new IllegalArgumentException("Not a valid champion level!");
        }
        int i = 1;
        for(final List<Doublee : getEffect()) {
            if(e == null) {
                continue;
            }
            text = text.replaceAll("\\{\\{ e" + i + " \\}\\}"e.get(spellLevel - 1).toString());
            i++;
        }
        for(final SpellVars var : getSpellVars()) {
            final List<Doublecoeffs = var.getCoeffs();
            Double val = coeffs.get(0);
            if(coeffs.size() == maxRank) {
                val = coeffs.get(spellLevel - 1);
            }
            else if(coeffs.size() == 18) {
                val = coeffs.get(champLevel - 1);
            }
            String replacement = val.toString();
            final String link = var.getLink();
            if(link.equals("attackdamage")) {
                replacement += " AD";
            }
            else if(link.equals("spelldamage")) {
                replacement += " AP";
            }
            text = text.replaceAll("\\{\\{ " + var.getKey() + " \\}\\}"replacement);
        }
        return text;
    }
    /*
     * (non-Javadoc)
     * @see java.lang.Object#toString()
     */
    @Override
    public String toString() {
        return getName();
    }
New to GrepCode? Check out our FAQ X