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

bot.model.query.QueryParser Maven / Gradle / Ivy

There is a newer version: 3.5.0
Show newest version
package bot.model.query;

import java.util.HashMap;
import java.util.Map;

/**
 * Created by Luca Mosetti on 2017
 * 

* Standard QueryParser * All the QueryParser use the same REGEX to split the CallbackQuery */ public class QueryParser implements Regex { public Query parse(String string) { return new Query(extractMap(string)); } private Map extractMap(String string) { Map map = new HashMap<>(); String[] parts = string.split(REGEX); for (String entry : parts) { map.put((entry.split(TWO_DOTS)[0]), entry.split(TWO_DOTS)[1]); } return map; } }





© 2015 - 2025 Weber Informatics LLC | Privacy Policy