All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.github.robertograham.fortniteapirestclient.util.StatNameHelper Maven / Gradle / Ivy

There is a newer version: 5.3.0
Show newest version
package io.github.robertograham.fortniteapirestclient.util;

import io.github.robertograham.fortniteapirestclient.domain.StatName;

public class StatNameHelper {

    public static StatName parse(String statName) {
        String[] components = statName.split("_");

        if (components.length == 5) {
            StatName product = new StatName();

            product.setGameMode(components[0]);
            product.setStatType(components[1]);
            product.setPlatform(components[2]);
            product.setUnknownProperty(components[3]);
            product.setPartyType(components[4]);

            return product;
        } else
            throw new IllegalArgumentException("Stat name did not have 5 components only");
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy