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

com.github.segmentio.models.Context Maven / Gradle / Ivy

package com.github.segmentio.models;


public class Context extends SafeProperties {

	private static final long serialVersionUID = 2042634726363431396L;

	private static final String IP_KEY = "ip";
	private static final String LIBRARY_KEY = "library";
	
	public Context() {
		super();
		addLibraryContext();
	}
	
	public Context(Object... kvs) {
		super(kvs);
		addLibraryContext();
	}
	
	private void addLibraryContext() {
		this.put(LIBRARY_KEY, "analytics-java");
	}
	
	public Context setIp(String ip) {
		this.put(IP_KEY, ip);
		return this;
	}
	
	public String getIp() {
		return (String)this.get(IP_KEY);
	}
	
	@Override
	public SafeProperties put(String key, Object value) {
		super.put(key, value);
		return this;
	}
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy