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

org.ccsds.moims.mo.mpd.structures.SecondaryErrorCodeEnum Maven / Gradle / Ivy

The newest version!
package org.ccsds.moims.mo.mpd.structures;

/**
 * Enumeration class for SecondaryErrorCodeEnum.
 */
public final class SecondaryErrorCodeEnum extends org.ccsds.moims.mo.mal.structures.Enumeration {

    private static final long serialVersionUID = 2533274807173126L;
    /**
     * The TypeId of this Element as a long.
     */
    public static final Long SHORT_FORM = 2533274807173126L;
    /**
     * The TypeId of this Element.
     */
    public static final org.ccsds.moims.mo.mal.TypeId TYPE_ID = new org.ccsds.moims.mo.mal.TypeId(SHORT_FORM);

    /**
     * Enumeration ordinal index for value UNKNOWN.
     */
    public static final int _UNKNOWN_INDEX = 0;

    /**
     * Enumeration numeric value for value UNKNOWN.
     */
    public static final org.ccsds.moims.mo.mal.structures.UInteger UNKNOWN_NUM_VALUE = new org.ccsds.moims.mo.mal.structures.UInteger(0);

    /**
     * Enumeration singleton for value UNKNOWN.
     */
    public static final org.ccsds.moims.mo.mpd.structures.SecondaryErrorCodeEnum UNKNOWN = new org.ccsds.moims.mo.mpd.structures.SecondaryErrorCodeEnum(org.ccsds.moims.mo.mpd.structures.SecondaryErrorCodeEnum._UNKNOWN_INDEX);

    /**
     * Enumeration ordinal index for value UNDEFINED.
     */
    public static final int _UNDEFINED_INDEX = 1;

    /**
     * Enumeration numeric value for value UNDEFINED.
     */
    public static final org.ccsds.moims.mo.mal.structures.UInteger UNDEFINED_NUM_VALUE = new org.ccsds.moims.mo.mal.structures.UInteger(1);

    /**
     * Enumeration singleton for value UNDEFINED.
     */
    public static final org.ccsds.moims.mo.mpd.structures.SecondaryErrorCodeEnum UNDEFINED = new org.ccsds.moims.mo.mpd.structures.SecondaryErrorCodeEnum(org.ccsds.moims.mo.mpd.structures.SecondaryErrorCodeEnum._UNDEFINED_INDEX);

    /**
     * Enumeration ordinal index for value OUT_OF_RANGE.
     */
    public static final int _OUT_OF_RANGE_INDEX = 2;

    /**
     * Enumeration numeric value for value OUT_OF_RANGE.
     */
    public static final org.ccsds.moims.mo.mal.structures.UInteger OUT_OF_RANGE_NUM_VALUE = new org.ccsds.moims.mo.mal.structures.UInteger(2);

    /**
     * Enumeration singleton for value OUT_OF_RANGE.
     */
    public static final org.ccsds.moims.mo.mpd.structures.SecondaryErrorCodeEnum OUT_OF_RANGE = new org.ccsds.moims.mo.mpd.structures.SecondaryErrorCodeEnum(org.ccsds.moims.mo.mpd.structures.SecondaryErrorCodeEnum._OUT_OF_RANGE_INDEX);

    /**
     * Enumeration ordinal index for value UNRECOGNIZED.
     */
    public static final int _UNRECOGNIZED_INDEX = 3;

    /**
     * Enumeration numeric value for value UNRECOGNIZED.
     */
    public static final org.ccsds.moims.mo.mal.structures.UInteger UNRECOGNIZED_NUM_VALUE = new org.ccsds.moims.mo.mal.structures.UInteger(3);

    /**
     * Enumeration singleton for value UNRECOGNIZED.
     */
    public static final org.ccsds.moims.mo.mpd.structures.SecondaryErrorCodeEnum UNRECOGNIZED = new org.ccsds.moims.mo.mpd.structures.SecondaryErrorCodeEnum(org.ccsds.moims.mo.mpd.structures.SecondaryErrorCodeEnum._UNRECOGNIZED_INDEX);

    /**
     * Enumeration ordinal index for value BAD_TIME.
     */
    public static final int _BAD_TIME_INDEX = 4;

    /**
     * Enumeration numeric value for value BAD_TIME.
     */
    public static final org.ccsds.moims.mo.mal.structures.UInteger BAD_TIME_NUM_VALUE = new org.ccsds.moims.mo.mal.structures.UInteger(4);

    /**
     * Enumeration singleton for value BAD_TIME.
     */
    public static final org.ccsds.moims.mo.mpd.structures.SecondaryErrorCodeEnum BAD_TIME = new org.ccsds.moims.mo.mpd.structures.SecondaryErrorCodeEnum(org.ccsds.moims.mo.mpd.structures.SecondaryErrorCodeEnum._BAD_TIME_INDEX);

    /**
     * Enumeration ordinal index for value INCONSISTENT.
     */
    public static final int _INCONSISTENT_INDEX = 5;

    /**
     * Enumeration numeric value for value INCONSISTENT.
     */
    public static final org.ccsds.moims.mo.mal.structures.UInteger INCONSISTENT_NUM_VALUE = new org.ccsds.moims.mo.mal.structures.UInteger(5);

    /**
     * Enumeration singleton for value INCONSISTENT.
     */
    public static final org.ccsds.moims.mo.mpd.structures.SecondaryErrorCodeEnum INCONSISTENT = new org.ccsds.moims.mo.mpd.structures.SecondaryErrorCodeEnum(org.ccsds.moims.mo.mpd.structures.SecondaryErrorCodeEnum._INCONSISTENT_INDEX);

    /**
     * Set of enumeration instances.
     */
    private static final org.ccsds.moims.mo.mpd.structures.SecondaryErrorCodeEnum[] _ENUMERATIONS = {UNKNOWN, UNDEFINED, OUT_OF_RANGE, UNRECOGNIZED, BAD_TIME, INCONSISTENT};

    /**
     * Set of enumeration string values.
     */
    private static final String[] _ENUMERATION_NAMES = {"UNKNOWN", "UNDEFINED", "OUT_OF_RANGE", "UNRECOGNIZED", "BAD_TIME", "INCONSISTENT"};

    /**
     * Set of enumeration values.
     */
    private static final org.ccsds.moims.mo.mal.structures.UInteger[] _ENUMERATION_NUMERIC_VALUES = {UNKNOWN_NUM_VALUE, UNDEFINED_NUM_VALUE, OUT_OF_RANGE_NUM_VALUE, UNRECOGNIZED_NUM_VALUE, BAD_TIME_NUM_VALUE, INCONSISTENT_NUM_VALUE};

    /**
     * 
     * @param ordinal null.
     */
    private SecondaryErrorCodeEnum(int ordinal) {
        super(ordinal);
    }

    /**
     * Returns a String object representing this type"s value.
     * 
     * @return a string representation of the value of this object.
     */
    public String toString() {
        switch (getOrdinal()) {
          case _UNKNOWN_INDEX:
            return "UNKNOWN";
          case _UNDEFINED_INDEX:
            return "UNDEFINED";
          case _OUT_OF_RANGE_INDEX:
            return "OUT_OF_RANGE";
          case _UNRECOGNIZED_INDEX:
            return "UNRECOGNIZED";
          case _BAD_TIME_INDEX:
            return "BAD_TIME";
          case _INCONSISTENT_INDEX:
            return "INCONSISTENT";
          default:
            throw new RuntimeException("Unknown ordinal!");
        }
    }

    /**
     * Returns the enumeration element represented by the supplied string, or 
     * null if not matched. 
     * 
     * @param s s The string to search for.
     * @return The matched enumeration element, or null if not matched.
     */
    public static org.ccsds.moims.mo.mpd.structures.SecondaryErrorCodeEnum fromString(String s) {
        for (int i = 0; i < _ENUMERATION_NAMES.length; i++) {
          if (_ENUMERATION_NAMES[i].equals(s)) {
            return _ENUMERATIONS[i];
          }
        }
        return null;
    }

    /**
     * Returns the nth element of the enumeration.
     * 
     * @param ordinal ordinal The index of the enumeration element to return. 
     * @return The matched enumeration element.
     */
    public static org.ccsds.moims.mo.mpd.structures.SecondaryErrorCodeEnum fromOrdinal(int ordinal) {
        return _ENUMERATIONS[ordinal];
    }

    /**
     * Returns the enumeration element represented by the supplied numeric value, 
     * or null if not matched. 
     * 
     * @param value value The numeric value to search for.
     * @return The matched enumeration value, or null if not matched.
     */
    public static org.ccsds.moims.mo.mpd.structures.SecondaryErrorCodeEnum fromNumericValue(org.ccsds.moims.mo.mal.structures.UInteger value) {
        for (int i = 0; i < _ENUMERATION_NUMERIC_VALUES.length; i++) {
          if (_ENUMERATION_NUMERIC_VALUES[i].equals(value)) {
            return _ENUMERATIONS[i];
          }
        }
        return null;
    }

    /**
     * Returns the index of the enumerated item as a {@code UOctet}.
     * 
     * @return the index of the enumerated item as a {@code UOctet}.
     */
    public org.ccsds.moims.mo.mal.structures.UOctet getOrdinalUOctet() {
        return new org.ccsds.moims.mo.mal.structures.UOctet(ordinal.shortValue());
    }

    /**
     * Returns the numeric value of the enumeration element.
     * 
     * @return The numeric value.
     */
    public org.ccsds.moims.mo.mal.structures.UInteger getNumericValue() {
        return _ENUMERATION_NUMERIC_VALUES[ordinal];
    }

    /**
     * Returns an instance of this type using the first element of the enumeration. 
     * It is a generic factory method but just returns an existing element of 
     * the enumeration as new values of enumerations cannot be created at runtime. 
     * 
     * @return The first element of the enumeration.
     */
    public org.ccsds.moims.mo.mal.structures.Element createElement() {
        return _ENUMERATIONS[0];
    }

    /**
     * Encodes the value of this object using the provided MALEncoder.
     * 
     * @param encoder The encoder to use for encoding.
     * @throws org.ccsds.moims.mo.mal.MALException if any encoding errors are 
     * detected. 
     */
    public void encode(org.ccsds.moims.mo.mal.MALEncoder encoder) throws org.ccsds.moims.mo.mal.MALException {
        encoder.encodeUOctet(new org.ccsds.moims.mo.mal.structures.UOctet(ordinal.shortValue()));
    }

    /**
     * Decodes the value of this object using the provided MALDecoder.
     * 
     * @param decoder The decoder to use for decoding.
     * @return Returns this object.
     * @throws org.ccsds.moims.mo.mal.MALException if any decoding errors are 
     * detected. 
     */
    public org.ccsds.moims.mo.mal.structures.Element decode(org.ccsds.moims.mo.mal.MALDecoder decoder) throws org.ccsds.moims.mo.mal.MALException {
        return fromOrdinal(decoder.decodeUOctet().getValue());
    }

    /**
     * Returns the TypeId of this element.
     * 
     * @return The TypeId of this element.
     */
    public org.ccsds.moims.mo.mal.TypeId getTypeId() {
        return TYPE_ID;
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy