uk.co.real_logic.artio.other.Side Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of artio-session-codecs Show documentation
Show all versions of artio-session-codecs Show documentation
High-Performance FIX Gateway
/* Generated Fix Gateway message codec */
package uk.co.real_logic.artio.other;
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;
}
}
}