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

com.emc.mongoose.base.logging.OperationTraceCsvBatchLogMessage Maven / Gradle / Ivy

There is a newer version: 4.3.10
Show newest version
package com.emc.mongoose.base.logging;

import com.emc.mongoose.base.item.Item;
import com.emc.mongoose.base.item.op.Operation;
import java.util.ArrayList;
import java.util.List;
import org.apache.logging.log4j.message.AsynchronouslyFormattable;

/** Created by andrey on 17.11.16. */
@AsynchronouslyFormattable
public final class OperationTraceCsvBatchLogMessage>
				extends LogMessageBase {

	private final List> opTraceRecords;
	private final int size;

	public OperationTraceCsvBatchLogMessage(final List opsResults, final int from, final int to) {
		size = to - from;
		opTraceRecords = new ArrayList<>(size);
		for (int i = from; i < to; i++) {
			opTraceRecords.add(new OperationTraceRecord<>(opsResults.get(i)));
		}
	}

	@Override
	@SuppressWarnings("unchecked")
	public final void formatTo(final StringBuilder strb) {
		if (size > 0) {
			for (int i = 0; i < size; i++) {
				opTraceRecords.get(i).format(strb);
			}
		}
	}
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy