libepg.ts.packet.TsPacketParcel.java Source code

Java tutorial

Introduction

Here is the source code for libepg.ts.packet.TsPacketParcel.java

Source

/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package libepg.ts.packet;

import org.apache.commons.lang3.builder.EqualsBuilder;
import org.apache.commons.lang3.builder.HashCodeBuilder;
import org.apache.commons.lang3.builder.ReflectionToStringBuilder;

/**
 * TS????????????
 *
 * @author normal
 */
public final class TsPacketParcel {

    /**
     * ??
     */
    public static enum MISSING_PACKET_FLAG {
        /**
         * ????(false)
         */
        NOT_MISSING(false),
        /**
         * ???(true)
         */
        MISSING_JUST_BEFORE(true);
        private boolean flag;

        private MISSING_PACKET_FLAG(boolean flag) {
            this.flag = flag;
        }

        public boolean getFlag() {
            return flag;
        }
    }

    private final MISSING_PACKET_FLAG MissingJustBefore;

    private final TsPacket packet;

    public TsPacketParcel(TsPacket packet, MISSING_PACKET_FLAG MissingJustBefore) {
        this.packet = packet;
        this.MissingJustBefore = MissingJustBefore;
    }

    /**
     * ??????false
     *
     * @return NOT_MISSING????????????????????
     */
    public MISSING_PACKET_FLAG isMissingJustBefore() {
        return MissingJustBefore;
    }

    @Override
    public int hashCode() {
        return HashCodeBuilder.reflectionHashCode(3, 97, this);
    }

    public TsPacket getPacket() {
        return packet;
    }

    /**
     * @return
     * ???????????????????????true
     */
    @Override
    public boolean equals(Object obj) {
        return EqualsBuilder.reflectionEquals(this, obj, true);
    }

    @Override
    public String toString() {
        return ReflectionToStringBuilder.toString(this);
    }

}