// Path: libraries/core/src/test/java/com/paritytrading/nassau/Value.java
// public class Value {
// 
//     private static final ToStringStyle STYLE = new StandardToStringStyle() {
//         {
//             setUseShortClassName(true);
//             setUseFieldNames(false);
//             setUseIdentityHashCode(false);
//             setContentStart("(");
//             setContentEnd(")");
//         }
//     };
// 
//     @Override
//     public boolean equals(Object obj) {
//         return EqualsBuilder.reflectionEquals(this, obj);
//     }
// 
//     @Override
//     public int hashCode() {
//         return HashCodeBuilder.reflectionHashCode(this);
//     }
// 
//     @Override
//     public String toString() {
//         return ToStringBuilder.reflectionToString(this, STYLE);
//     }
// 
// }


import static com.paritytrading.nassau.soupbintcp.SoupBinTCPSessionStatus.*;
import com.paritytrading.nassau.Value;
import java.util.ArrayList;
import java.util.List;
/*
 * Copyright 2014 Nassau authors
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package com.paritytrading.nassau.soupbintcp;



class SoupBinTCPClientStatus implements SoupBinTCPClientStatusListener {

    private List<Event> events;

    public SoupBinTCPClientStatus() {
        this.events = new ArrayList<>();
    }

    public List<Event> collect() {
        return events;
    }

    @Override
    public void loginAccepted(SoupBinTCPClient client, SoupBinTCP.LoginAccepted payload) {
        String session        = payload.getSession();
        long   sequenceNumber = payload.getSequenceNumber();

        events.add(new LoginAccepted(session, sequenceNumber));
    }

    @Override
    public void loginRejected(SoupBinTCPClient client, SoupBinTCP.LoginRejected payload) {
        events.add(new LoginRejected(payload.getRejectReasonCode()));
    }

    @Override
    public void endOfSession(SoupBinTCPClient client) {
        events.add(new EndOfSession());
    }

    @Override
    public void heartbeatTimeout(SoupBinTCPClient client) {
        events.add(new HeartbeatTimeout());
    }

    public interface Event {
    }

// Path: libraries/core/src/test/java/com/paritytrading/nassau/Value.java
// public class Value {
// 
//     private static final ToStringStyle STYLE = new StandardToStringStyle() {
//         {
//             setUseShortClassName(true);
//             setUseFieldNames(false);
//             setUseIdentityHashCode(false);
//             setContentStart("(");
//             setContentEnd(")");
//         }
//     };
// 
//     @Override
//     public boolean equals(Object obj) {
//         return EqualsBuilder.reflectionEquals(this, obj);
//     }
// 
//     @Override
//     public int hashCode() {
//         return HashCodeBuilder.reflectionHashCode(this);
//     }
// 
//     @Override
//     public String toString() {
//         return ToStringBuilder.reflectionToString(this, STYLE);
//     }
// 
// }


// Path: libraries/core/src/test/java/com/paritytrading/nassau/soupbintcp/SoupBinTCPClientStatus.java
import static com.paritytrading.nassau.soupbintcp.SoupBinTCPSessionStatus.*;
import com.paritytrading.nassau.Value;
import java.util.ArrayList;
import java.util.List;

/*
 * Copyright 2014 Nassau authors
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package com.paritytrading.nassau.soupbintcp;



class SoupBinTCPClientStatus implements SoupBinTCPClientStatusListener {

    private List<Event> events;

    public SoupBinTCPClientStatus() {
        this.events = new ArrayList<>();
    }

    public List<Event> collect() {
        return events;
    }

    @Override
    public void loginAccepted(SoupBinTCPClient client, SoupBinTCP.LoginAccepted payload) {
        String session        = payload.getSession();
        long   sequenceNumber = payload.getSequenceNumber();

        events.add(new LoginAccepted(session, sequenceNumber));
    }

    @Override
    public void loginRejected(SoupBinTCPClient client, SoupBinTCP.LoginRejected payload) {
        events.add(new LoginRejected(payload.getRejectReasonCode()));
    }

    @Override
    public void endOfSession(SoupBinTCPClient client) {
        events.add(new EndOfSession());
    }

    @Override
    public void heartbeatTimeout(SoupBinTCPClient client) {
        events.add(new HeartbeatTimeout());
    }

    public interface Event {
    }

    public static class LoginAccepted extends Value implements Event {