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

com.barchart.ondemand.api.IndexMembersRequest Maven / Gradle / Ivy

There is a newer version: 2.0.2
Show newest version
package com.barchart.ondemand.api;

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

public class IndexMembersRequest implements OnDemandRequest {

	private final String symbol;
	private final String fields;

	private final Map params = new HashMap();

	private IndexMembersRequest(final Builder b) {

		this.symbol = b.symbol;

		this.fields = "";

	}

	@Override
	public String endpoint() {

		return "getIndexMembers.json";
	}

	@Override
	public String name() {

		return "Index Members";
	}

	@Override
	public Map parameters() {

		params.put("symbol", symbol);

		if (!fields.isEmpty()) {
			params.put("fields", fields);
		}

		return params;
	}

	public static class Builder {
		private String symbol;

		public Builder symbol(final String symbol) {
			this.symbol = symbol;
			return this;
		}

		public OnDemandRequest build() {
			return new IndexMembersRequest(this);
		}
	}

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy