Search in sources :

Example 1 with DataValue

use of com.bencodez.advancedcore.api.user.usercache.value.DataValue in project VotingPlugin by Ben12345rocks.

the class VotingPluginVelocity method getValue.

private int getValue(ArrayList<Column> cols, String column, int toAdd) {
    for (Column d : cols) {
        if (d.getName().equalsIgnoreCase(column)) {
            DataValue value = d.getValue();
            int num = 0;
            if (value.isInt()) {
                num = value.getInt();
            } else if (value.isString()) {
                try {
                    num = Integer.parseInt(value.getString());
                } catch (Exception e) {
                }
            }
            return num + toAdd;
        }
    }
    return toAdd;
}
Also used : Column(com.bencodez.advancedcore.api.user.userstorage.Column) DataValue(com.bencodez.advancedcore.api.user.usercache.value.DataValue) SQLException(java.sql.SQLException) IOException(java.io.IOException)

Example 2 with DataValue

use of com.bencodez.advancedcore.api.user.usercache.value.DataValue in project VotingPlugin by Ben12345rocks.

the class VotingPluginBungee method getValue.

private int getValue(ArrayList<Column> cols, String column, int toAdd) {
    for (Column d : cols) {
        if (d.getName().equalsIgnoreCase(column)) {
            DataValue value = d.getValue();
            int num = 0;
            if (value.isInt()) {
                num = value.getInt();
            } else if (value.isString()) {
                try {
                    num = Integer.parseInt(value.getString());
                } catch (Exception e) {
                }
            }
            return num + toAdd;
        }
    }
    return toAdd;
}
Also used : Column(com.bencodez.advancedcore.api.user.userstorage.Column) DataValue(com.bencodez.advancedcore.api.user.usercache.value.DataValue) SQLException(java.sql.SQLException)

Aggregations

DataValue (com.bencodez.advancedcore.api.user.usercache.value.DataValue)2 Column (com.bencodez.advancedcore.api.user.userstorage.Column)2 SQLException (java.sql.SQLException)2 IOException (java.io.IOException)1