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

uk.co.real_logic.artio.Side Maven / Gradle / Ivy

There is a newer version: 0.160
Show newest version
/* Generated Fix Gateway message codec */
package uk.co.real_logic.artio;

import uk.co.real_logic.artio.dictionary.CharArrayMap;
import uk.co.real_logic.artio.dictionary.CharArrayWrapper;
import org.agrona.collections.IntHashSet;
import java.util.Map;
import java.util.HashMap;
import uk.co.real_logic.artio.builder.CharRepresentable;
import uk.co.real_logic.artio.dictionary.Generated;

@Generated("uk.co.real_logic.artio")
public enum Side implements CharRepresentable
{
    BUY('1'),
    SELL('2'),
    NULL_VAL(''),
    ARTIO_UNKNOWN('');

    private final char representation;

    Side(final char representation)
    {
         this.representation = representation;
    }

    public final char representation() { return representation; }

    private static final IntHashSet intSet = new IntHashSet(4);
        static
    {
        intSet.add('1');
        intSet.add('2');
    }



    public static boolean isValid(final int representation)
    {
        return intSet.contains(representation);
    }
    public static Side decode(final int representation)
    {
        switch(representation)
        {
        case '1': return BUY;
        case '2': return SELL;
        default:
            return ARTIO_UNKNOWN;
        }
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy