Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
Creative commons Attribution-NonCommercial license. http://creativecommons.org/licenses/by-nc/2.5/au/deed.en_GB NO WARRANTY IS GIVEN OR IMPLIED, USE AT YOUR OWN RISK.
 
 package base.jee.api.cassandra;
 
import base.Query;
import static base.jee.api.cassandra.util.Log.log;
public class GetPersonSettings extends Query<KeyValue> {
	private CassandraAPI api;
	private User user;
	private UUID person;
	public GetPersonSettings(CassandraAPI apiUser userUUID person) {
		this. = api;
		this. = user;
		this. = person;
	}
	public GetPersonSettings() {
	}
	public Query<KeyValuenewWithParameters(Map<StringObjectparameters) {
		return new GetPersonSettings(
				(CassandraAPI)parameters.get("api"),
				(User)parameters.get("user"),
				UUID.fromString((String)parameters.get("person")));
	}
	public List<KeyValueexecute() throws IOException {
		List<KeyValueresults = new LinkedList<>();
			log(s"WARN""Permission denied invoking: " + GetPersonSettings.class.getSimpleName() + " " + getJsonParameters());
			throw new IllegalStateException("You do not have permission to lookup settings");
		}
		for(Row r : s.execute(s.prepare("select name, value from person_setting where uuid=?").bind())) {
			results.add(new KeyValue(r.getString(0), r.getString(1)));
		}
		return results;
	}
		return "{" +
				"\"person\":" + ( == null?"null":"\"" + .getPersonUuid() + "\"") +
				"}";
	}
New to GrepCode? Check out our FAQ X