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

com.emc.mongoose.common.supply.ConstantStringSupplier Maven / Gradle / Ivy

The newest version!
package com.emc.mongoose.common.supply;

import java.util.List;

/**
 Created by andrey on 24.10.16.
 */
public final class ConstantStringSupplier
implements BatchSupplier {

	protected final String value;

	public ConstantStringSupplier(final String value) {
		this.value = value;
	}

	@Override
	public final String get() {
		return value;
	}

	@Override
	public final int get(final List buffer, final int limit) {
		for(int i = 0; i < limit; i ++) {
			buffer.add(value);
		}
		return limit;
	}

	@Override
	public final long skip(final long count) {
		return count;
	}

	@Override
	public final void reset() {
	}

	@Override
	public final void close() {
	}
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy