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

com.paritytrading.parity.client.event.Errors Maven / Gradle / Ivy

There is a newer version: 0.5.0
Show newest version
package com.paritytrading.parity.client.event;

import org.eclipse.collections.api.list.ImmutableList;
import org.eclipse.collections.api.list.MutableList;
import org.eclipse.collections.impl.factory.Lists;

public class Errors extends DefaultEventVisitor {

    private MutableList errors;

    private Errors() {
        errors = Lists.mutable.with();
    }

    public static ImmutableList collect(Events events) {
        Errors visitor = new Errors();

        events.accept(visitor);

        return visitor.getEvents();
    }

    private ImmutableList getEvents() {
        return errors.toImmutable();
    }

    @Override
    public void visit(Event.OrderRejected event) {
        errors.add(new Error(event));
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy