com.emc.mongoose.base.config.ConstantValueInputImpl Maven / Gradle / Ivy
package com.emc.mongoose.base.config;
import java.util.List;
public final class ConstantValueInputImpl implements ConstantValueInput {
private final T val;
public ConstantValueInputImpl(final T val) {
this.val = val;
}
@Override
public final T get() {
return val;
}
@Override
public int get(final List buffer, final int limit) {
for (var i = 0; i < limit; i++) {
buffer.add(val);
}
return limit;
}
@Override
public final long skip(final long count) {
return count;
}
@Override
public final void reset() {}
@Override
public final void close() {}
}